Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

i18n  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Reader,
In properties file I have the following

message.alphanumeric = A {0} contains only letters and numbers.

where {0} is replaced with the 2nd argument of

ActionError("message.alphanumeric", "Registration Number"); object.

However if I have message.alphanumeric in a different language, how to modify
ActionError(), to pick "Registration Number" in proper language from a properties file, instead of hard coding it?
Thanks in advance
Garandi
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the getResources() method in your Action superclass.

ActionError("message.alphanumeric", super.getResources(request, "registration.number.label"));

This method will get the message using the current locale, just as a <bean:message> would.
 
My pie came with a little toothpic holding up this tiny ad:
Download Free Java APIs to Work with Office Files and PDF
htttp://www.e-iceblue.com/free-apis.html
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!