The main method is to join a filter Web.xml to join the following:
SetcharacterenceeCodingFilter.java
Package edu.bit.dick.Article;
import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; import Javax.Servlet.unavailableException;
Public class setcharacterencodingfilter imports filter {public void init (filter void in) throws servletexception {} public void destroy () {}
public void doFilter (ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {request.setCharacterEncoding ( "GB18030"); // passes control to the next filter chain.doFilter (request, response);}}