public class FreemarkerViewTool extends FreeMarkerView
Spring里是这样加的
<bean id="viewResolver"
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
<property name="cache" value="false"/>
<property name="prefix" value=""/>
<property name="suffix" value=".ftl"/>
<property name="exposeSpringMacroHelpers" value="true"/>
<property name="exposeRequestAttributes" value="true"/>
<property name="exposeSessionAttributes" value="true"/>
<property name="requestContextAttribute" value="rc"/>
<property name="contentType" value="text/html;charset=UTF-8"/>
<property name="order" value="0"/>
<!-- 自定义FreeMarkerView,用来定义项目的全局路径 -->
<property name="viewClass" value="com.llh.passport.util.FreemarkerViewTool"/>
</bean>
Nutz里咋弄啊