![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Javaweb
zywcj1314
小菜鸟
展开
-
servlet中出现中文乱码
servlet中的alert返回到前端的页面中中文乱码??,在代码中加入如下代码 //设置服务器输出的编码为UTF-8 response.setCharacterEncoding("UTF-8"); //告诉浏览器输出的内容是html,并且以utf-8的编码来查看这个内容。 response.setContentType("text/html;charset=utf-8"); PrintWriter out = response.getWriter(); out.p原创 2020-07-28 20:01:14 · 79 阅读 · 0 评论 -
jsp实现返回上一页并刷新页面
返回上一页 jsp中实现返回上一页 window.history.back(); 刷新 返回后刷新页面试了很多种方法,最后只有这个方法有效 <script type="text/javascript"> if(window.name != "bencalie"){ location.reload(); window.name = "bencalie"; } ...原创 2020-07-28 19:56:39 · 1403 阅读 · 0 评论