• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Struts 2 internationalization with a dynamic key

 
Greenhorn
Posts: 3
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.

I'm trying to internationalize an application, but I can't pass a key to the <s:text/> dynamically. Instead of recovering the value from the properties file, the key is being displayed at the page to the user.

This is my example action:



This is my TestAction.properties file:



When i pass the key directly into the JSP the struts recover the correct value..



But when i try to get the key from the java action, instead of looking for it's value it just show's the key! I've tried the followings ways to recover the text:




but none of them works.. does anyone have an idea how to solve this?

Thanks!

 
Ranch Hand
Posts: 188
Hibernate Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi felipe issa,

i did not understand what you are trying to do in your application,
anyway you can get the value of the key in action also, like

hope this would help you.


 
felipe issa
Greenhorn
Posts: 3
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi debraj mallick!

That doesn't work on my case. I'll use the properties file to internationalize the application. When the user is from Us, for instance, the struts will get the value from the default file TestAction.properties. But when user is from other countries, like Brazil, struts will look for the value in the properties file 'TestAction_br.properties' for the value (or in the default file when it doesn't exists.)

But thanks for your answer anyway!
 
felipe issa
Greenhorn
Posts: 3
Hibernate Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Resolved it using

 
LOOK! OVER THERE! (yoink) your tiny ad is now my tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic