q599159992
2015-10-26 10:01FreeMarker 设置模板存放路径的问题,请大神过目。。
<bean id="freemarkerConfig" class="org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer">
<property name="templateLoaderPath" value="/web"/>
<property name="freemarkerVariables">
<map>
<!-- 在FCK编辑器中需要用到appBase,以确定connector路径。 -->
<entry key="appBase" value="/dgadmin/dgcms" />
<!-- 后台管理权限控制 -->
<entry key="cms_perm" value-ref="cms_perm"/>
<entry key="text_cut" value-ref="text_cut"/>
<entry key="html_cut" value-ref="html_cut"/>
<entry key="cms_content_list" value-ref="cms_content_list"/>
<entry key="cms_content_page" value-ref="cms_content_page"/>
</map>
</property>
<property name="freemarkerSettings">
<props>
<prop key="template_update_delay">0</prop>
<prop key="defaultEncoding">UTF-8</prop>
<prop key="url_escaping_charset">UTF-8</prop>
<prop key="locale">zh_CN</prop>
<prop key="boolean_format">true,false</prop>
<prop key="datetime_format">yyyy-MM-dd HH:mm:ss</prop>
<prop key="date_format">yyyy-MM-dd</prop>
<prop key="time_format">HH:mm:ss</prop>
<prop key="number_format">0.######</prop>
<prop key="whitespace_stripping">true</prop>
<prop key="auto_import">/ftl/dgcms/index.ftl as p,/ftl/spring.ftl as s</prop>
</props>
</property>
</bean>
这里吧路径配置到项目web目录下, 但是公司要求一切资源文件不许放到项目里,, 就要把文件放到别的目录中,,,在这网上有解决方案是 file:D://XXXX 我试过好多次都不行。。。也不知道它底层是怎么找的。 为什么放到项目本身就可以, 难倒它取的是项目的根目录吗? 那么如果这样,改怎么解决吧模板放到其他盘符的问题。。。 对了, 在windows
下能用, linux上不会有任何影响吗?
- 点赞
- 回答
- 收藏
- 复制链接分享
2条回答
为你推荐
- freemarker页面get型参数转码问题
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- 关于Freemarker小数点问题.
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- 用freemarker后引入CSS和JS的路径问题
- struts
- 0个回答
- freemarker在WEB-INF下引用外部CSS、JS、图片文件的路径问题
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
- FreeMarker取Session问题
- it技术
- 互联网问答
- IT行业问题
- 计算机技术
- 编程语言问答
- 0个回答
换一换