Struts2 Actions 通常扩展ActionSupport实现TextProvider接口的类,并使用方法以方便的方式提供对资源包文件的访问getText()。
我想在拦截器中使用资源包。我想我必须复制TextProvider实现并将其粘贴到我的拦截器中。
我已经定义了全局资源文件struts.xml
<constant name="struts.custom.i18n.resources" value="resources.global" />
并放入global.properties包装中resources。
它在动作类中运行良好
有没有更简单的方法在拦截器中使用资源包?