javaweb-JSP nine of built-in objects

A, JSP principle

  So when accessing a jsp page, you are actually visiting a Servlet, jsp server at the time of execution, the first to translate into a jsp _jspServlet, and then invoked in the invocation servlet.

 Since the first time will be translated into JSP servlet when accessed, so the first visit is usually slow, but the second visit, JSP server if it is found there is no change, no longer translation, but directly called, so program execution efficiency is not affected.

  When calling JSP server corresponding _jspSerlvet, passed or create nine related objects and web development for _jspServlet use. Designers JSP technology in order to facilitate developers get a web object when writing JSP page references, specifically defines nine corresponding variables, developers can quickly obtain a reference to an object through these nine variables in the JSP page.

Second, recognize nine built-in objects

NO. Built-in objects Types of
1 pageContext javax.servlet.jsp.PageContext
2 request javax.servlet.http.HttpServletRequest
3 response javax.servlet.http.HttpServletResponse
4 session javax.servlet.http.HttpSession
5 application javax.servlet.ServletContext
6 config javax.servlet.ServletConfig
7 out javax.servlet.jsp.JspWriter
8 page java.lang.Object
9 exception java.lang.Throwable

 

 

 

 

 

 

 

 

request, response, session, application, config in front of these objects have already made a detailed introduction, here focus on what the rest of the pageContext object, out the object, page object.

Third, the built-in objects for use

  3.1, page objects

  a JSP page object that represents the current page, can be understood as an object in itself, namely: the JSP as an object to look at. page almost no objects in development, you can find out.

  3.2, out objects

    

 

Guess you like

Origin www.cnblogs.com/sacai/p/11621102.html