Tuesday, 23 December 2014

Message Properties use in struts2

in struts2.x we can access properties file properties in

jsp and action classes( which extends ActionSupport) very easily

the following step will help to access properties file in easy manner....

Step 1: Create struts.properties in src folder.
Step 2: Create any properties file in src folder (let suppose messages.proprerties).
Step 3: copy and past following line in struts.properties
struts.custom.i18n.resources=message
Step4: let suppose the following one are properties in message.properties
unAuthorize=Your not Eligible to Acess...!
exception= Exception is Raised.
sessionExpire= Your Session is Over ...!

Step 5: if u want those properites in Jsp page...
<s:property value="getText('sessionExpire')"/>
Step 6: if u want those properties in action class
getText("unAuthorize");

Message properties use in struts 2

No comments:

Post a Comment