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 Soft Skills this week in the Jobs Discussion 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