jsp小结14 - 9个内置对象07 request

request:

javax.servlet.http.HttpServletRequest的实例,该对象封装了一次请求,客户端的请求都被封装在该对象里

如果POST请求的请求参数包含了非西欧字符,则必须在获取请求参数之前先调用setCharacterEncoding()方法设置字符集

如果是GET方法请求包含了非西欧字符,则先获取参数,再使用URLDecoder解码,处理

执行forward或include:(路径必须以斜线开头)

forward(ServletRequest request , ServletResponse response)

include(ServletRequest request , ServletResponse response)

getRequestDispatcher("/a.jsp").include(request, response):将a.jsp,include到本页面

getRequestDispatcher("/a.jsp").forward(request, response):将请求forward到a.jsp

你可能感兴趣的:(jsp)