tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Frank W. Zammetti" <fzli...@omnytex.com>
Subject Re: filter: How to set browser encoding?
Date Wed, 12 Oct 2005 15:08:02 GMT
Mark, have a look here:

http://javawebparts.sourceforge.net/javadocs/javawebparts/filter/CharacterEncodingFilter.html

Just added that to JWP last weekend :)  It essentially calls
request.setCharacterEncoding() with whatever you configure.

(Oops... ignore the description of the encodingScheme parameter... just
realized I have a cut-and-paste error in the javadoc.  D'oh!).

-- 
Frank W. Zammetti
Founder and Chief Software Architect
Omnytex Technologies
http://www.omnytex.com
AIM: fzammetti
Yahoo: fzammetti
MSN: fzammetti@hotmail.com

On Wed, October 12, 2005 10:53 am, Mark said:
> Hi everybody,
> I've got a request from my client to force an encoding in the
> browser, regardless what user have set.
>
> When I set encoding inside my filter to Windows-1257 in the HTML
> source code I see only ?s:??? ????? ???.
>
> Is there any easy way to enforce browser to set proper encoding?
>
>
> May be I need to setContent type after I obtain a writer in the
> servlet?
> Note, all outputs are generated by servlets:
>
> public void doPost( HttpServletRequest req, HttpServletResponse resp
> )
>       throws IOException, ServletException
> {
>   // do something
>     resp.setContentType("text/html");
>     resp.getWriter().println(output);
> }
>
>
> In MyFilter.doFilter() I do following:
> (HttpServletResponse)response).setContentType("text/html;charset=Windows-1257")
>
> I use 5.0.28 with Redhat 9.
> Any input is welcome.
>
> Thanks!
> Mark.
>
>
>
>
> __________________________________
> Yahoo! Mail - PC Magazine Editors' Choice 2005
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


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


Mime
View raw message