java——乱码

  

 protected void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException,IOException{
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html;charset=UTF-8");
        String message= request.getParameter("message");
        response.getWriter().println(message);
        response.getWriter().println("
"); String contextPath=request.getServletContext().getContextPath(); response.getWriter().println("contextPath:"+contextPath); }

  修改Tomcat的server.xml


java——乱码_第1张图片

  

你可能感兴趣的:(*【Java】,——————日常(Java))