File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Internationlization problem

malek aftab

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 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
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:
subject: Internationlization problem
It's not a secret anymore!