File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Struts 2: Localization not working

vikas sharmaa
Ranch Hand

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

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

but, its not displaying the value of from the file. please let me know where am going wrong?
David Newton

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:
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