您的位置:首页 > Web前端 > JavaScript

JSP九大内置对象基础

2015-01-13 10:24 218 查看

1.JSP 九个内置

1.request GBK GB2312 UTF-8

getParameter

setAttribute

getAttribute

getRequestDispatcher

setCharacterEncoding

getRequestURI

getRequestURL

2.response 客户端响应信息

response.sendRedirect();

request跳转和 response 跳转

request: http://localhost:8080/0927pjt/one.jsp
response:http://localhost:8080/0927pjt/three.jsp
http://localhost:8080/0927pjt/twio.jsp
区别1 request 会隐藏跳转路径 response暴漏跳转路径

区别2 request 在跳转过程中保持一次请求 response会产生多次请求

区别3 request 站内跳转(内部跳转) response 站外跳转(外部跳转)

淘宝

支付宝

银行

3.session一次会话

setAttribute

getAttribute

session 一次会话 HttpSession

getServletContext

setMaxInactiveInterval 30分钟 session回收

invalidate

关闭浏览器

4.application 全局应用 ServletContext

setAttribute

getAttribute

5.out 输出println

6.page

7.pageContext

8.config web.xml

9.exception 错误页 500

创建一个jsp isErrorPage="true"

errorPage="error.jsp"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: