wood burning stoves 2.0*
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
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 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

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!!!
wood burning stoves
subject: Struts 2: Localization not working
Similar Threads
pass values between pages using Struts2
Struts2 Issue with localization: Messages not picked up from properties file for forward actions.
How to use CSS with Struts Tags?
Struts 2 - i18n Chinese localization issue
Ant task to unzip , merge n zip ear for websphere