SE452: Implicit Objects and their Scope [5/12] ![]() ![]() ![]() |
Objects can be manipulated in JSP.
Objects exist in different scopes:
Remember, and object created inside a method would only have scope in that
method as well. In Java, we also limit scope by using the { }
An object with a given scope is accessible to pages that are in the same scope as the page where the object was created. (more on this later)
Certain objects are created implicitly for each page by the container:
requestresponsepageContextsessionapplicationoutconfigpageexception - for error pages onlyrequest
javax.servlet.ServletRequest (i.e.
javax.servlet.http.HttpServletRequest)
response
javax.servlet.ServletResponse
(i.e. javax.servlet.http.HttpServletResponse)
pageContext
getOut(), getException(), getPage() getRequest(),
getResponse(), getSession(), getServletConfig() and
getServletContext().
setAttribute(), getAttribute(), findAttribute(),
removeAttribute(), getAttributesScope() and
getAttributeNamesInScope().
forward(), include(), and
handlePageException().session
javax.servlet.http.HttpSession)application
getServletConfig().getContext() in a servletout
javax.servlet.jsp.JspWriterconfig
javax.servlet.ServletConfig that you would get
from calling getServletConfig() in a servletpage
java.lang.Objectexception
java.lang.Throwable