📄 abstractpagecmdaction.java
字号:
package com.easyjf.web.core;
import com.easyjf.web.Globals;
import com.easyjf.web.Module;
import com.easyjf.web.Page;
import com.easyjf.web.WebForm;
/**
* 用来支持更加灵活的参数调用方式。
*
* @author 大峡
*
*/
abstract public class AbstractPageCmdAction extends AbstractCmdAction {
public Page execute(WebForm form, Module module) throws Exception {
Page forward = super.execute(form, module);
if (forward == null && !"".equals(this.command)) {
forward = this.forwardPage;
if (forward == null)
forward = module.findPage(this.command);
if (forward == null) {
String templateUrl = module.getViews() + module.getPath() + "/"
+ this.command;
if (this.getTemplatePerfix() != null)
templateUrl = this.getTemplatePerfix() + templateUrl;
String ext = getTemplateExt();
if (ext.charAt(0) == '.')
ext = ext.substring(1);
forward = new Page(this.getClass() + this.command, templateUrl
+ "." + ext);
}
}
return forward;
}
protected String getTemplateExt() {
return Globals.DEFAULT_TEMPLATE_EXT;
}
/**
* 设置模板路径前缀
*
* @return
*/
protected String getTemplatePerfix() {
return "/";
}
public Page doInit(WebForm form, Module module) {
this.command = "index";
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -