[已办理]Tomcat 9.0.97控制台乱码
maven3.8.1JDK11
Tomcat9.0.97
修改apache-tomcat-9.0.97\conf\logging.properties文件:
https://i-blog.csdnimg.cn/direct/1e19f921147f4f0abcfc4588cfbdd5ad.png
@WebServlet("/login")
public class LoginServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
req.setCharacterEncoding("UTF-8");
String username = req.getParameter("username");
String userPwd = req.getParameter("userPwd");
System.out.println("用户名:" + username);
System.out.println("密码:" + userPwd);
resp.setContentType("text/html;charset=utf-8");
PrintWriter writer = resp.getWriter();
writer.write(username + "<h1>登录成功!</h1>");
writer.close();
}
} https://i-blog.csdnimg.cn/direct/79b831267c8e4d3f9f79fdd99b0d454e.png
https://i-blog.csdnimg.cn/direct/609b70da992346c588772f44db3cc44c.png
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页:
[1]