Chinese garbage problem after JavaWeb / forward jump to the jsp page

  

  Code in question:

dispatcher = getServletContext().getRequestDispatcher("/Login.jsp");

dispatcher.forward(request,response);
There is a problem:
after the jump past Chinese garbled.
To solve the problem:
Use
response.setContentType ( "text / html; charset = UTF-8"); to solve
problem causes:
Use the PrintWriter out = response.getWriter (); 
As for what the principle is not clear
 

Guess you like

Origin www.cnblogs.com/wu199723/p/11594326.html