1: There are generally two solutions to the problem of page garbled characters:
The problem of garbled servlet output:
response.setCharacterEncoding("utf-8");
request.setCharacterEncoding("UTF-8");
2: Servlet. Unlike the built-in object that has a session in a jsp page, it is generally necessary to declare it first, such as:
Httpsession session=request.getSession(), the same application cannot be used directly, it should be
ServletContext application=this.getServletContext() can only be used
3: Generally, it is not necessary to redirect to a certain page after transferring data, but forwarding should be used. (for convenience)
4: servlet: Method 1: To inherit HttpServlet
To return html in the servlet, set response.setContentType("text/html");