当前位置: 代码迷 >> Eclipse >> jsp-servlet中怎么弹出信息框
  详细解决方案

jsp-servlet中怎么弹出信息框

热度:22   发布时间:2016-04-23 13:58:07.0
jsp--servlet中如何弹出信息框
我是一个Jsp--Servlet的初学者,如何在Servlet跳转页面时弹出信息提示框,比如说提示用户--注册成功...
我不要Request.setAttribute("message","注册成功")这种方法,还有其它的吗?

------解决方案--------------------
使用out 把打印出 一段js 代码 alert 就可以了
------解决方案--------------------
out.print("<script type='javascript/text'>alert('注册成功')</script>")
------解决方案--------------------
顶楼上的!
------解决方案--------------------
一般都是用JS写。
------解决方案--------------------
使用jsp内置对象的out就行了
PrintWrite Out = response.getWrite();
out.print(" <script type='javascript/text'>alert('注册成功');</script>")这样就可以了
------解决方案--------------------
直接通过JSP判断就行了。
------解决方案--------------------
PrintWrite Out = response.getWrite(); 
out.print(" <script type='javascript/text'>alert('注册成功'); </script>")

大多这样可以实现
  相关解决方案