Using Gettext() For The Getting Property In Struts 2
I am working on the Struts2 framework with JSP. In my samplePrj.properties file, in that com.samplePrj.Successmessage = Saved Successful is an attribute. I need to use this value
Solution 1:
Use the text
tag
<s:i18nname="samplePrj"><s:textname="com.samplePrj.Successmessage" /></s:i18n>
it will load the bundle using i18n
tag from samplePrj.properties
and print the value from key com.samplePrj.Successmessage
in it.
or you can use it with getText()
but your action class should extend ActionSupport
.
<s:propertyvalue="getText('com.samplePrj.Successmessage')"/>
Post a Comment for "Using Gettext() For The Getting Property In Struts 2"