When learning JSP, sometimes the Page forms are submitted with garbled characters
Make the following changes to see if there will be garbled characters:
(I am using a UTF-8 code // gb2312)
1. Modify the workspace encoding in myeclipse
Preferences --- >>>
2. Modify the encoding of the relevant file. Generally, after the workspace encoding is modified, the corresponding file will automatically adjust its default encoding.
Preferences --- >>>
3. Page Import
<% @ Page Language = "Java" pageencoding = "UTF-8" %>
4. Add the
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8">
5. Change the form submission method to method = "Post"
6. You can also directly modify the server's encoding settings (Tomcat server ),
There is a CONF file in the tomcat installation directory, which contains a server. xml file
Modification:
<Connector Port = "8080" protocol = "HTTP/1.1"
Connectiontimeout = "20000"
Redirectport = "8443" type = "regxph" text = "yourobjectname"/>
Change
<Connector Port = "8080" protocol = "HTTP/1.1"
Connectiontimeout = "20000"
Redirectport = "8443"
Url = "UTF-8" usebodyencodingforuri = "true"/>
Summary