服务器:
Connector port="8081" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/>
表单jsp页面:
<meta charset="utf-8"/> <%@ page contentType="text/html;charset=UTF-8" language="java" %>
接受数据的serlvet:
req.setCharacterEncoding("utf-8"); String name=req.getParameter("name"); System.out.println("____________________"+name); String text=req.getParameter("container"); System.out.println("_______________-------------------"+text);
myeclipse 也在preference/myeclipse/files and ediotr 调成了utf-8
在jsp页面输入数据,servlet打印输出的是乱码???????????????
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:744) ____________________æ _______________-------------------<p>大声d</p>