Spring mvc配置文件如下
1.配置freemarker的视图,have separate FreeMarker template files for the different locales. So for the view "homepage" with locale US English, the viewresolver should find the template file homepage_en_us.ftl Failing that, homepage_en.ftl, failing that homepage.ftl如下
class="org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver">
requestContextAttribute属性一般我们都是通过它获取上下文信息,比如我们可以获取全局变量的项目路径等等信息。attributesMap这个才是我们获取java静态方法的属性配置。
2.freemarkerStaticModels配置如下:
class="org.springframework.beans.factory.config.PropertiesFactoryBean">
class="org.springrain.frame.util.FreemarkerStaticModels" factory-method="getInstance">
3.javastatic.properties属性配置文件内容如下:
StringUtils=org.apache.commons.lang3.StringUtils
4.使用配置文件的如下:
${StringUtil.replaceAll("${name!''}",";","-")}
h Ruby on Rails (concerning the RESTful pattern..). I have my Spring web app configured and am now ready to try some basic stuff like forms and so on but I can't find any tutorials on using Spring MVC with freemarker. Since I have neither e