66、10.1 概述

本文详细介绍了如何在JFinal框架中将默认的FreeMarker视图引擎切换为JSP。内容包括修改视图扩展名、在configConstant方法中配置ViewType为JSP的完整代码示例,适用于需要在eclipse jee中正确识别HTML或使用JSP作为默认视图的开发者。

JFinal 默认使用 FreeMarker 作为 View,为了使 eclipse jee 能正确识别 html,所以默认使 用”.html”作为 FreeMarker 视图文件的扩展名(原为”.ftl”)。

如果需要使用 JSP 作为默认视图需要在 configConstant(Constants me)方法中进行配置,见 如下配置:

public void configConstant(Constants me) { me.setDevMode( true); me.setViewType(ViewType. JSP);
}