Win a copy of Get Programming with Java (MEAP only) this week in the Beginning Java 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Internationalization of Struts program  RSS feed

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi i am planning to have different messages picked up from the aplication resouces properties file but it doesn't seem to work The ApplicationResources.properties file resides in my classes->com folder and there is an entry for this key as
app.title=CRS
but this <bean:message key="app.title" /> doesn't work.
The same happens to display an error besides html component
if the user name is empty then i add error as
errors.add("userID", new ActionError("error.userID.required"))
as per the book i have an entry for error.userID.required in teh resource file as
error.userID.required=<li>User ID cant be null</li>
and i try to print the error as <html:errors property="userID"/>

Lastly i have defined the mapping for the application resource file in the strutsconfig.xml as
<message-resources parameter="com.ApplicationResources" />
Any help will be appreciated
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you add
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
in your jsp?
 
Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i did have the tag lib decleration at the beginning of the page
 
Rashid Darvesh
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello. I am still unable to display the value from the application resources file. just dont know what's wrong with this. the only thing i get is some string like ???en_US.app.title??? . Can anyone help with this
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you added the ApplicationResources.properties file to the controller servlet in the web.xml file. as init-param
<init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>
 
They weren't very bright, but they were very, very big. Ad contrast:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!