【Servlet】response.getWriter().wirte寫完不顯示?

問題:

response.getWriter().wirte寫完不顯示

分析:

PrintWriter沒有flush

解決:

PrintWriter pw = response.getWriter();
pw.write("<script   language=javascript>alert('登錄信息有誤');window.location='login.html'</script>");
pw.flush();

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章