| Author |
WAR between global properties file and package/Action level properties file
|
MaheshS Kumbhar
Ranch Hand
Joined: Sep 24, 2009
Posts: 188
|
|
I have a RegisterAction_es.properties file [for spanish locale] inside Action class package and global.properties file with global scope(declared inside struts.xml file)
Package structure is as bellow
src
|
struts2.Register.Action -->RegisterAction.java Action class, RegisterAction_es.properties file
|
struts.Register.Model --> Person.java class
|
global.properties file
|
struts.xml file
WebRoot
|
META-INF
|
WEB-INF
|
index.jsp,register_with_key.jsp
There are two links on index.jsp page to go to register_with_key.jsp page. The intension is that if we click the first link, the form labels on register_with_key.jsp page should be displayed in spanish, and if second link is clicked, form labels on register_with_key.jsp page should be displayed in english.
But here, form labels are displayed in spanish for both the links.
ie. RegisterAction_es.properties file always wins over global.properties file irrespective of locales.
and if we make RegisterAction.properties file as Action level and global_es.properties with global scope, then the form labels are displayed in english for both the links irrespective of the locales.
Thus action level properties file always takes priority over global file.
How to solve this problem?
index.jsp file is as below
The following textfield tag is used in register_with_key.jsp page
<s:textfield key="beanPerson.firstName"/>
|
I am slow but sure
|
 |
MaheshS Kumbhar
Ranch Hand
Joined: Sep 24, 2009
Posts: 188
|
|
|
Can anyone please answer my question?
|
 |
MaheshS Kumbhar
Ranch Hand
Joined: Sep 24, 2009
Posts: 188
|
|
Please help
|
 |
 |
|
|
subject: WAR between global properties file and package/Action level properties file
|
|
|