内置对象
- pageContext
- request
- response
- Sessioln
- Application(ServletContext)
- config(ServletConfig)
- out
- page
- exception
作用域
pageContext:保存的数据只在一个页面有效
request:只在一次请求中有效,请求转发也会有
session:在一次会话中有效,打开浏览器至关闭浏览器
application:在服务器中有效,打开服务器到关闭服务器
特殊:
pageContext可以设置作用域:
pageContext.setAttribute("ad","ads",scope)
scope可以是上面四个作用域
EL表达式
样式:${}
等效于:<%= %>
区别:没有该变量时,前者没有输出,后者输出null
转发
JSP中:pageContext.forward();
java中:dispatcher…