在Java国际化(i18n)中,

vm页面显示内容需要使用 #springMessage("title")

实际运行时发现页面输出$springMacroRequestContext.getMessage($code)。看了一下源代码,#springMessage是一个宏,在spring.vm中定义为

#macro( springMessage $code )$springMacroRequestContext.getMessage($code)#end

原因是因为未找到$springMacroRequestContext...

解决方法:在我们定义视图resolver中加入对spring宏的支持

<bean >
        ...
        <property name="exposeSpringMacroHelpers" value="true"/>
</bean>

 

 

 

相关文章:

  • 2022-12-23
  • 2021-11-08
  • 2022-12-23
  • 2021-09-07
  • 2021-09-13
  • 2021-10-17
  • 2022-03-06
猜你喜欢
  • 2021-08-09
  • 2021-12-27
  • 2022-02-02
  • 2022-12-23
  • 2021-06-23
相关资源
相似解决方案