File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes @page contentType= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "@page contentType="text/html; charset=UTF-8" ...  seems not working" Watch "@page contentType="text/html; charset=UTF-8" ...  seems not working" New topic
Author

@page contentType="text/html; charset=UTF-8" ... seems not working

Alexey Pilipchuk
Greenhorn

Joined: Jan 30, 2006
Posts: 9
Hi all
I experienced problem with page ecoding- some characters weren't rendered properly.
All my JSP had

<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

directive set but it didn't help. The only solution I have found it to set http header manualy like that:

<% response.setHeader("Content-Type", "text/html; charset=utf-8"); %>

So the question is why <%@ page contentType=...%> does not affect http headers? And if it does not intent to what is it for?

App server - tomcat 5.5.17

Tnaks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: @page contentType="text/html; charset=UTF-8" ... seems not working
 
Similar Threads
Forwarding Response from Servlet to JSP
How to force encoding of web browser to UTF-8
Unicode convert problem with Jboss in Linux
Struts 2: Encoding UTF-8 problems
how can i choose the right encoding to read arabic