You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by Yansheng Lin <ya...@isogis.com> on 2003/12/04 20:58:54 UTC

Request encoding problem

Hi,

I have trouble processing user's input using UTF-8 encoding.  I can change to
different locales with 
  <fmt:setLocale value='${sessionScope["org.apache.struts.action.LOCALE"]}'/>, 
but I don't think 
  <fmt:requestEncoding value='UTF-8'/> 
is working for me right now. I already set the page encoding in my hearder with:
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">

Here is my Systen.out in the beginning of dispatchAction():

        System.out.println(request.getCharacterEncoding());
        System.out.println(request.getContentType());
        System.out.println(request.getLocale());        

And this is what I get:
	  null
	  application/x-www-form-urlencoded
	  en_US

I am not sure what's missing right now.  Do I have to set anything in the
web.xml?

Thanks in advance!

-Yan


---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Re: Request encoding problem

Posted by Kris Schneider <kr...@dotech.com>.
You might want to read through the *very* recent thread, "fmt_rt encoding
trouble", and see if that helps any...

Quoting Yansheng Lin <ya...@isogis.com>:

> 
> Hi,
> 
> I have trouble processing user's input using UTF-8 encoding.  I can change
> to
> different locales with 
>   <fmt:setLocale
> value='${sessionScope["org.apache.struts.action.LOCALE"]}'/>, 
> but I don't think 
>   <fmt:requestEncoding value='UTF-8'/> 
> is working for me right now. I already set the page encoding in my hearder
> with:
>   <meta http-equiv="content-type" content="text/html; charset=UTF-8">
> 
> Here is my Systen.out in the beginning of dispatchAction():
> 
>         System.out.println(request.getCharacterEncoding());
>         System.out.println(request.getContentType());
>         System.out.println(request.getLocale());        
> 
> And this is what I get:
> 	  null
> 	  application/x-www-form-urlencoded
> 	  en_US
> 
> I am not sure what's missing right now.  Do I have to set anything in the
> web.xml?
> 
> Thanks in advance!
> 
> -Yan

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org