jsp的内置对象&pagecontext操作其他域对象

jsp的内置对象:(9大内置对象)

   在jsp页面上可以直接使用的对象
    内置对象            类型

    1.out                JspWriter

    2.request            HttpServletRequest

    3.response        HttpServletResponse

    4.session            HttpSession

    5.exception        Throwable

    6.page            Servlet(this)   

    7.config            ServletConfig

    8.application        ServletContext
        
    9.pageContext        PageContext

jsp的域对象:理解(使用时能使用生命周期最短就使用最短的)

    application        整个项目
    session            一次会话
    request            一次请求
    pageContext        一个页面

pagecontext作用:

    1.域对象
            xxxAttribute()
    2.操作其他域对象
        方法:
        xxxAttribute(...,int scope);
        scope取值:
            APPLICATION_SCOPE
            SESSION_SCOPE
            REQUEST_SCOPE
            PAGE_SCOPE

pagecontext操作其他的域对象源码:

 jsp的内置对象&pagecontext操作其他域对象
    3.获取其他的内置对象
        getXxx()
        注意: getRequest():获取request内置对象
    4.便捷查找,
        findAttribute(String key):
        依次从pagecontext,request,session,application四个域中,查找相应的属性,
                若查找到了返回值,且结束该次查找
        若查找不到,返回一个null
源码:
 jsp的内置对象&pagecontext操作其他域对象