继承渲染工厂
/** * 统一加上后缀 * * @author Luyao * */ public class SuffixRenderFactory extends RenderFactory { @Override public Render getRender(String view) { return super.getRender(view + ".html"); // 或是.jsp } }
2.添加到常量配置
public void configConstant(Constants me) { me.setDevMode(prop.getBoolean("devMode", false)); // 统一添加页面后缀名 me.setRenderFactory(new SuffixRenderFactory()); }
3.使用
@Before(GET.class) public void index() { render("index"); }