File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Struts 2: Localization not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts 2: Localization not working" Watch "Struts 2: Localization not working" New topic
Author

Struts 2: Localization not working

vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
after going through the Localization site, i created package.properties file in the action directory. contents of package.properties file is:



then, in jsp file, i fetch the mytest.name property as follows:



but, its not displaying the value of mytest.name from the package.properties file. please let me know where am going wrong?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Are you accessing the JSP directly, or going through an Action? That won't work.

If going through an action, does it either extend ActionSupport or implement its own TextProvider (and LocaleProvider if you need it)? If not, it won't work.

vikas sharmaa
Ranch Hand

Joined: Jun 28, 2007
Posts: 191
great newton! i was testing localisation on my welcome file that was not going through action. now, i tried the same in another jsp that was coming from an action class and it works! thanks a lot!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Struts 2: Localization not working
 
Similar Threads
Struts2 Issue with localization: Messages not picked up from properties file for forward actions.
Ant task to unzip , merge n zip ear for websphere
Struts 2 - i18n Chinese localization issue
How to use CSS with Struts Tags?
pass values between pages using Struts2