This page demonstrates the <wtfigo:attributes> tag. This tag can be used to help you determine what objects are available to your JSP page and what key and scope needs to be used to access them.
This example puts a sample bean (org.wtfigo.demo.SampleBean1) into the session and request scopes under the keys "mySessionScopeBean" and "myRequestScopedBean". The sample bean has various types of properties including scalar, mapped, and indexed properties.
Note: Several servlet container internal objects are available through the various scopes. These objects are not meant to accessed by JSP developers. Feel free to ignore objects that are not germane to your application.
The most typical usage of this tag is to find an object that you, or your framework, have put
into the request scope. The tag defaults to displaying only request scoped object.
Output of <wtfigo:attributes />
Request Scope:
Usage: ${requestScope.KEY} or ${requestScope['KEY']}
| Key | Class | Value |
|---|---|---|
| myRequestScopedBean | org.wtfigo.demo.pojo.SampleBean1 | SampleBean1: string1=String1;string2=String2;map={key1=value1, key3=value3, key2=value2};sampleBean... |
| ReqFilter.FILTERED | java.lang.Boolean | true |
Another way to use this tag is to display every object in all four scopes. You can also have the
appropriate JSTL EL syntax displayed for each object.
Output of <wtfigo:attributes scope="ALL" showEL="true" showValues="true" />
Application Scope:
Usage: ${applicationScope.KEY} or ${applicationScope['KEY']}
| Key | Class | Value | JSTL EL |
|---|---|---|---|
| __oscache_cache | com.opensymphony.oscache.web.ServletCache | com.opensymphony.oscache.web.ServletCache@f2f585 | ${applicationScope['__oscache_cache']} |
| org.apache.jasper.runtime.JspApplicationContextImpl | org.apache.jasper.runtime.JspApplicationContextImpl | org.apache.jasper.runtime.JspApplicationContextImpl@2445d7 | ${applicationScope['org.apache.jasper.runtime.JspApplicationContextImpl']} |
| org.apache.myfaces.config.RuntimeConfig | org.apache.myfaces.config.RuntimeConfig | org.apache.myfaces.config.RuntimeConfig@1335b86 | ${applicationScope['org.apache.myfaces.config.RuntimeConfig']} |
| org.springframework.web.context.WebApplicationContext.ROOT | org.springframework.web.context.support.XmlWebApplicationContext | org.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplication... | ${applicationScope['org.springframework.web.context.WebApplicationContext.ROOT']} |
| org.apache.AnnotationProcessor | org.apache.catalina.util.DefaultAnnotationProcessor | org.apache.catalina.util.DefaultAnnotationProcessor@bdec44 | ${applicationScope['org.apache.AnnotationProcessor']} |
| org.apache.myfaces.shared_impl.webapp.webxml.WebXml | org.apache.myfaces.shared_impl.webapp.webxml.WebXml | org.apache.myfaces.shared_impl.webapp.webxml.WebXml@e29f36 | ${applicationScope['org.apache.myfaces.shared_impl.webapp.webxml.WebXml']} |
| org.apache.catalina.WELCOME_FILES | java.lang.String[2] | [index.jsp, index.html] | ${applicationScope['org.apache.catalina.WELCOME_FILES']} |
| __oscache_admin | com.opensymphony.oscache.web.ServletCacheAdministrator | com.opensymphony.oscache.web.ServletCacheAdministrator@1be996d | ${applicationScope['__oscache_admin']} |
| org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring | org.springframework.web.context.support.XmlWebApplicationContext | org.springframework.web.context.support.XmlWebApplicationContext: display name [WebApplicationConte... | ${applicationScope['org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring']} |
| org.apache.myfaces.webapp.StartupServletContextListener.FACES_INIT_DONE | java.lang.Boolean | true | ${applicationScope['org.apache.myfaces.webapp.StartupServletContextListener.FACES_INIT_DONE']} |
| wtfigo.oscache.monitor | org.wtfigo.controller.ViewOSCache$OSCacheMonitor | StatisticListenerImpl: Hit = 0 / 0, stale hit = 0 / 0, miss = 0 / 0, flush = 0 | ${applicationScope['wtfigo.oscache.monitor']} |
| org.apache.catalina.resources | org.apache.naming.resources.ProxyDirContext | org.apache.naming.resources.ProxyDirContext@10a0d51 | ${applicationScope['org.apache.catalina.resources']} |
| org.apache.catalina.jsp_classpath | java.lang.String | /opt/wtftomcat/webapps/wtfigo-demo/WEB-INF/classes/:/opt/wtftomcat/webapps/wtfigo-demo/WEB-INF/lib/... | ${applicationScope['org.apache.catalina.jsp_classpath']} |
| javax.servlet.context.tempdir | java.io.File | /opt/wtftomcat/work/Catalina/localhost/wtfigo-demo | ${applicationScope['javax.servlet.context.tempdir']} |
| org.springframework.web.servlet.FrameworkServlet.CONTEXT.itemlist | org.springframework.web.context.support.XmlWebApplicationContext | org.springframework.web.context.support.XmlWebApplicationContext: display name [WebApplicationConte... | ${applicationScope['org.springframework.web.servlet.FrameworkServlet.CONTEXT.itemlist']} |
Session Scope:
Usage: ${sessionScope.KEY} or ${sessionScope['KEY']}
| Key | Class | Value | JSTL EL |
|---|---|---|---|
| mySessionScopedBean | org.wtfigo.demo.pojo.SampleBean1 | SampleBean1: string1=String1;string2=String2;map={key1=value1, key3=value3, key2=value2};sampleBean... | ${sessionScope['mySessionScopedBean']} |
Request Scope:
Usage: ${requestScope.KEY} or ${requestScope['KEY']}
| Key | Class | Value | JSTL EL |
|---|---|---|---|
| myRequestScopedBean | org.wtfigo.demo.pojo.SampleBean1 | SampleBean1: string1=String1;string2=String2;map={key1=value1, key3=value3, key2=value2};sampleBean... | ${requestScope['myRequestScopedBean']} |
| ReqFilter.FILTERED | java.lang.Boolean | true | ${requestScope['ReqFilter.FILTERED']} |
Page Scope:
Usage: ${pageScope.KEY} or ${pageScope['KEY']}
| Key | Class | Value | JSTL EL |
|---|---|---|---|
| javax.servlet.jsp.jspApplication | org.apache.catalina.core.ApplicationContextFacade | org.apache.catalina.core.ApplicationContextFacade@12c5431 | ${pageScope['javax.servlet.jsp.jspApplication']} |
| javax.servlet.jsp.jspPage | org.apache.jsp.demo.tagAttributes_jsp | org.apache.jsp.demo.tagAttributes_jsp@fde7ba | ${pageScope['javax.servlet.jsp.jspPage']} |
| javax.servlet.jsp.jspSession | org.apache.catalina.session.StandardSessionFacade | org.apache.catalina.session.StandardSessionFacade@de24c5 | ${pageScope['javax.servlet.jsp.jspSession']} |
| javax.servlet.jsp.jspResponse | org.apache.catalina.connector.ResponseFacade | org.apache.catalina.connector.ResponseFacade@402e11 | ${pageScope['javax.servlet.jsp.jspResponse']} |
| javax.servlet.jsp.jspOut | org.apache.jasper.runtime.JspWriterImpl | org.apache.jasper.runtime.JspWriterImpl@1906773 | ${pageScope['javax.servlet.jsp.jspOut']} |
| javax.servlet.jsp.jspPageContext | org.apache.jasper.runtime.PageContextImpl | org.apache.jasper.runtime.PageContextImpl@177c977 | ${pageScope['javax.servlet.jsp.jspPageContext']} |
| javax.servlet.jsp.jspConfig | org.apache.catalina.core.StandardWrapperFacade | org.apache.catalina.core.StandardWrapperFacade@17a6686 | ${pageScope['javax.servlet.jsp.jspConfig']} |
| javax.servlet.jsp.jspRequest | org.apache.catalina.connector.RequestFacade | org.apache.catalina.connector.RequestFacade@8e2fb5 | ${pageScope['javax.servlet.jsp.jspRequest']} |