tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ognjen Blagojevic <ogn...@etf.bg.ac.yu>
Subject Re: UTF-8 charset encoding
Date Mon, 19 Nov 2007 10:21:59 GMT
Tremal Naik wrote:
> Oh, yes, you're right. I'm using version 1.1, that's why probably I
> don't have that option available. Unfortunately I'm not allowed to
> upgrade to a newer version...

I suppose you are using ActionForms. Try to extend ActionForm overriding 
your reset method which will set the character encoding, before the 
parameters are processed. Something like this:

public class UTF8ActionForm extends ActionForm {
     public void reset(ActionMapping mapping,
             HttpServletRequest request) {
         super.reset(mapping, request);
         try {
             request.setCharacterEncoding("UTF-8");
         } catch (UnsupportedEncodingException ioe) {
             throw new RuntimeException(ioe.getMessage());
         }
     }
}

And then just instead of using ActionForm use UTF8ActionForm.

And try asking on Struts mailing list, there should be more people who 
solved the same problem.

Regards,
Ognjen

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message