Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Internationlization problem

 
malek aftab
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everybody,
I am using java internalization API in my J2EE web application implemented by struts framework,
I defined ApplicationResources.properties files in struts-config.xml file, and a made an action to change Locale, I wrote a filter to set character encoding of request, all my JSP files encoding are UTF-8
but it does not work correctly,
has anyone know what can I do to fix it?

struts-config.xml------->I define ApplicationResources.properties
web.xml-------->I defined a filter to set encodig of request
JSP files------>set Character Encoding of all of them to UTF-8
use <bean:message key="..."/> to show internationalized message
Struts Action--->change my Locale to show corresponding message

what should I do then?
 
Dom Lassy
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can set up a filter. Add to web.xml:

That means whenever a .do or .jsp is encountered, that it will run the filter com.whatever.EncodingTypeFilter. And here is what that class should look like:

It handles both the request and response.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic