• 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

Internationalization of Struts program

 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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>
 
These are not the droids you are looking for. Perhaps I can interest you in a tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic