JSTL implicit variables 

Joined:
08/13/2009
Posts:
31

March 03, 2010 05:16:40    Last update: April 02, 2010 16:30:03
Implicit variables are always available to JSTL - you don't need to set them before using them.
  1. Page context: pageContext

    pageContext properties:
    NameTypeDescription
    pagejavax.servlet.ServletThe current servlet request
    requestjavax.servlet.ServletRequestThe current servlet request
    responsejavax.servlet.ServletResponseThe current servlet response
    servletConfigjavax.servlet.ServletConfigThe servlet config
    servletContextjavax.servlet.ServletContextThe application
    sessionjavax.servlet.http.HttpSessionThe current HTTP session


    Note: request, response etc., is not directly available, you access them with pageContext.request, pageContext.response, etc.

  2. Scope variables: pageScope, requestScope, sessionScope, applicationScope

    NameTypeDescription
    pageScopejava.util.MapName-value pair of page scoped variables
    requestScopejava.util.MapName-value pair of request scoped variables
    sessionScopejava.util.MapName-value pair of session scoped variables
    applicationScopejava.util.MapName-value pair of application scoped variables


  3. Parameters, HTTP headers and cookies: param, paramValues, header, headerValues, cookie, initParam

    NameTypeDescription
    paramjava.util.MapAccess to parameter values. Key is parameter name; value is the first value associated with the name.
    paramValuesjava.util.MapAccess to parameter values. Key is parameter name; value is a list associated with the name
    headerjava.util.MapAccess to header values. Key is header name; value is the first value associated with the name.
    headerValuesjava.util.MapAccess to header values. Key is header name; value is a list associated with the name
    cookiejava.util.MapAccess to cookies. Key is cookie name; value is the value associated with the name
    initParamjava.util.MapAccess to application initialization parameters in web.xml.

[ Comment  | Tags ]