This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Struts and the fly likes Internationlization problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Internationlization problem" Watch "Internationlization problem" New topic
Author

Internationlization problem

malek aftab
Greenhorn

Joined: Jun 04, 2006
Posts: 12
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

Joined: May 05, 2006
Posts: 181
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.
 
GeeCON Prague 2014
 
subject: Internationlization problem