Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struts 2: Localization not working

 
vikas sharmaa
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic