jQuery in Action, 2nd edition*
The moose likes Struts and the fly likes WAR between global properties file and package/Action level properties file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "WAR between global properties file and package/Action level properties file" Watch "WAR between global properties file and package/Action level properties file" New topic
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: WAR between global properties file and package/Action level properties file
 
Similar Threads
Problem With I18n feature of Struts2
Struts2 key attribute
struts2 properties file reload
Localization with Struts2 help, not persisting to any other pages
global properties file