当前位置: 代码迷 >> JavaScript >> 深入显出 jsp and servlet 第二版 读书笔记
  详细解决方案

深入显出 jsp and servlet 第二版 读书笔记

热度:593   发布时间:2012-09-03 09:48:39.0
深入浅出 jsp and servlet 第二版 读书笔记
1st. redirect= client = 客户端跳转
request = server = 服务器端跳转
A request redirect is different from a request dispatch. A request dispatch
(covered more in another chapter) happens on the server, while a redirect
happens on the client. A request dispatch hands the request to another
component on the server, usually within the same web app. A request
redirect simply tells the browser to go a different URL

?
2nd. HttpServletResponse 常用方法 setContentType, getWriter

3rd. To redirect a request, call sendRedirect(aStringURL) on the response.

4th. You cannot call sendRedirect() after the response is committed! In other
words, if you’ve already written something to the stream, it’s too late to do
a redirect.
  相关解决方案