📄 helloaction.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -