解决在servlet中的中文输出为问号的问题

在response.getWriter().write();的前面输入
response.setContentType("text/html;charset=GBK");
response.setContentType("text/html");

就解决了。

猜你喜欢

转载自blog.csdn.net/qq_35653657/article/details/80491366