servlet中print alert的时候怎么直接把代码显示出来了?
如题
代码这样写的
- Java code
response.getWriter().print("<script>alert(\"用户名或密码错误!\");document.location='index.jsp';</script>");在IE9下是直接把这代码打印出来了,在低版本IE没问题,请问是怎么回事???
[解决办法]
需要写Content-type
发布时间: 2012-10-13 11:38:17 作者: rapoo
servlet中print alert的时候怎么直接把代码显示出来了?
如题
代码这样写的
response.getWriter().print("<script>alert(\"用户名或密码错误!\");document.location='index.jsp';</script>");