How to add multiple .property files in Sturts-config.xml file..?

If any one knows the answer plz add..

Showing Answers 1 - 12 of 12 Answers

Jayakanthan

  • Oct 26th, 2006
 

hi friend ,in struts-config.xml file message-resources tag is therein that place you have to put how many u want just include

  Was this answer useful?  Yes

Rajesh

  • Oct 26th, 2006
 

 Yes we can specify multiple .properties file in struts-config.xml.

  Was this answer useful?  Yes

Sanjib Mallick

  • Jan 19th, 2007
 

We can add multiple .properties files in Struts-config.xml in the following way
<message-resources key="bundle1" parameter="MessageResources1" />
<message-resources key="bundle2" parameter="MessageResources2" />
and in jsp page we have to use <bean:message bundle="bundle1" key="test" />
where
MessageResources1.properties has a key value pair
test=My Test
Then it will display My Test in .jsp file .

<message-resources parameter="resone" key="rbone"/>
<message-resources parameter="restwo" key="rbtwo"/>

in order to access the resources

<bean:message key="rone" bundle="rbone"/>
 <bean:message key="rfour" bundle="rbtwo"/>

resone_en_us.properties
rone="value of rone"
rtwo="value of rtwo"

resone_fr_ca.properties
rone="value of rone"                    BUNDLE-1
rtwo="value of rtwo"
 
--------------------------------
restwo_en_us.properties
rthree="value of rone"
rfour="value of rtwo"
                                                            Bundle-2
restwo_fr_ca.properties
rthree="value of rone"
rfour="value of rtwo"

---------------------------

  Was this answer useful?  Yes

VIRAT REDDY

  • Jul 30th, 2011
 

By configuring in struts config file as follows:

Code
  1. <struts-config>

  2.     <form-beans>

  3.                -------------------------

  4.                 ----------------------------

  5. </form-beans>

  6. <action-mappings>

  7.     --------------------

  8.        ----------------------

  9. </action-mappings>

  10. <message-resources parameter="name of prop file1"/>

  11. <message-resources parameter="name of prop file2"/>

  12. ------------------------

  13. --------------

  14. -

  15. </struts-config>



  Was this answer useful?  Yes

Vani.Y

  • Aug 14th, 2011
 

By assigning a key attribute to each property file,while configuring in struts configuration file.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions