This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Internationlization problem
 
Similar Threads
Strange problem with Resource files and I18n
Struts: The Complete Reference - Internationalizaion ???
Displaying Japanese characters in JSP
How to force encoding of web browser to UTF-8
problem dispaly error message in struts