[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - How to set Character Encoding correctly?
spec_third
do-not-reply at jboss.com
Thu Jul 13 00:06:25 EDT 2006
Hi,anybody help me
I write two jsp files. Content as following:
a.jsp
------------------------------------------------
| <%@ page language="java" contentType="text/html; charset=UTF-8"%>
| <html>
| <HEAD>
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
| </HEAD>
| <body>
| <script language="javascript">
| function _goto(){
| location.href=encodeURI("b.jsp?names=??");
| }
| </script>
| </body>
| </html>
b.jsp
------------------------------------------------------------------
| <%@ page language="java" contentType="text/html; charset=UTF-8"%>
| <html>
| <HEAD>
| <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
| </HEAD>
| <body>
| <%
| request.setCharacterEncoding("UTF-8");
| String names = request.getParameter("names");
| System.out.println("Names:"+names);
| %>
| </body>
| </html>
following is configuration:
jbossweb-tomcat50.sar/server.xml
| <Service name="jboss.web" className="org.jboss.web.tomcat.tc5.StandardService">
| <Connector useBodyEncodingForURI="true" URIEncoding="UTF-8"/>
|
Console print:
Names:????????????
While I set 'useBodyEncodingForURI' to false,Console print is OK:
Names:??
why? what is real meaning of 'useBodyEncodingForURI=true'.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3957617#3957617
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3957617
More information about the jboss-user
mailing list