JSP transfer data to the background garbled solution __js
Source: Internet
Author: User
The top of the page configuration: <%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%> web.xml file to write the code filter, which is as follows:
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
Note: (The above code must be written at the beginning of the Web.xml) if not, add the enctype= "Multipart/form-data" attribute to the form forms as follows: <form action= "Adduser.action" method= "Post" enctype= "Multipart/form-data" > All pages are configured with a uniform encoding UTF-8 (or GB2312 or GBK) apache-tomcat-6.0.20\conf\ Server.xml, the contents are as follows:
<connector port= "8080" protocol= "http/1.1"
connectiontimeout= "20000"
Redirectport= "8443" urlencoding= "UTF-8" usebodyencodingforuri= "true"/> jsp page plus the following: <% @page contenttype= "text /html;charset=utf-8 "pageencoding=" Utf-8 "%>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.