Struts2 Actions normally extend ActionSupport class which implements of TextProvider interface and provides access to resource bundle files in a convenient way using getText() method.
I want to use resource bundle in Interceptors. I guess I have to copy TextProvider implementation and paste it in my interceptor.
I have already defined global recourse file in struts.xml
<constant name="struts.custom.i18n.resources" value="resources.global" />
And place global.properties in resources package.
It works fine in Action Classes
Is there any easier way to use resource bundle in interceptors?
Your can use the
java.util.ResourceBundleclass.