helloaction.java

来自「一个简单的java邮件系统源码」· Java 代码 · 共 33 行

JAVA
33
字号
package com.easyjweb.action;

import java.util.Date;
import com.easyjf.web.IWebAction;
import com.easyjf.web.Module;
import com.easyjf.web.Page;
import com.easyjf.web.WebForm;
/**  
 * EasyJWeb的Hello World程序
 * @author 
 *
 */
public class helloAction implements IWebAction {
	private com.easyjweb.business.Person person;
	
	public void setPerson(com.easyjweb.business.Person person) {
		this.person = person;
	}

	/**
	 * EasyJWeb的action需要实现IWebAction接口即可,该接口只有一个方法execute。
	 */
	public Page execute(WebForm form, Module module) throws Exception {
		form.addResult("msg", "喂,您好,我是EasyJWeb,请支持国产开源项目!");// 设置VO对象msg的值为String
		//System.out.println(com.easyjf.web.core.FrameworkEngine.getContainer().getBean("person"));
		System.out.println(person);
		// “喂,您好,我是EasyJWeb,请支持国产开源项目!”
		form.addResult("time", new Date());// 设置VO对象time的值为当前时间
		return new Page("hello","/hello.html","template");
		//	return module.findPage("hello");
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?