我的包com.caobug.client.support.view
有分页宏pagination.ftl
和FreeMarkerConfigurer.java
FreeMarkerConfigurer.java:
public class FreeMarkerConfigurer extends org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer {
@Override
protected void postProcessTemplateLoaders(List<TemplateLoader> templateLoaders) {
super.postProcessTemplateLoaders(templateLoaders);
templateLoaders.add(new ClassTemplateLoader(FreeMarkerConfigurer.class, ""));
}
}
弹簧views.xml:
<bean id="freeMarkerConfigurer" class="com.caobug.client.support.view.FreeMarkerConfigurer">
<property name="defaultEncoding" value="utf-8"/>
<property name="templateLoaderPath" value="/WEB-INF/"/>
<property name="freemarkerSettings">
<props>
<prop key="template_update_delay">10</prop>
<prop key="locale">zh_CN</prop>
<prop key="number_format">0.####</prop>
<prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop>
<prop key="classic_compatible">true</prop>
<prop key="template_exception_handler">ignore</prop>
</props>
</property>
<property name="freemarkerVariables">
<map>
<entry key="shiro">
<bean class="com.caobug.tags.account.ShiroTags"/>
</entry>
<entry key="messageTotal">
<bean class="com.caobug.tags.account.MessageCountTag"/>
</entry>
</map>
</property>
</bean>
demo.ftl:
<#import "/pagination.ftl" as pagination />
==> #import "/pagination.ftl" as pagination [in template "demo.ftl" at line 1, column 1]
----------
我该怎么办?