Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how use multilingual in struts application?  RSS feed

 
sandeeps srivastava
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi , i create a employement form with some fields like name, password , date of birth etc.
i want to this form also in hindi language ,i ceate an .properties file with application_hi.properties and passing field name in hindi, then i add this code in web.xml <init-param>
<param-name>application</param-name>
<param-value>ApplicationResources</param-value>
</init-param>

in struts-config.xml

<message-resources parameter="resources.ApplicationResources_hi"/>

in jsp page

<% request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8"); %>

<html:html locale="true"/>

but when deploy in tomcat container then fields name are showed as ???

please help me
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The problem is with the entry in your struts-config.xml file. Even though the property file itself should have the language suffix, the entry in struts-config.xml should not have the suffix. Change your entry to:

If you want to see messages displayed in Hindi, go to your browser and make sure Hindi is the first language selected.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!