WTFIGO Demo

WTFIGO Tags: Attributes

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.

Example 1

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']}

KeyClassValue
myRequestScopedBeanorg.wtfigo.demo.pojo.SampleBean1SampleBean1: string1=String1;string2=String2;map={key1=value1, key3=value3, key2=value2};sampleBean...
ReqFilter.FILTEREDjava.lang.Booleantrue

Example 2

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']}

KeyClassValueJSTL EL
__oscache_cachecom.opensymphony.oscache.web.ServletCachecom.opensymphony.oscache.web.ServletCache@f2f585${applicationScope['__oscache_cache']}
org.apache.jasper.runtime.JspApplicationContextImplorg.apache.jasper.runtime.JspApplicationContextImplorg.apache.jasper.runtime.JspApplicationContextImpl@2445d7${applicationScope['org.apache.jasper.runtime.JspApplicationContextImpl']}
org.apache.myfaces.config.RuntimeConfigorg.apache.myfaces.config.RuntimeConfigorg.apache.myfaces.config.RuntimeConfig@1335b86${applicationScope['org.apache.myfaces.config.RuntimeConfig']}
org.springframework.web.context.WebApplicationContext.ROOTorg.springframework.web.context.support.XmlWebApplicationContextorg.springframework.web.context.support.XmlWebApplicationContext: display name [Root WebApplication...${applicationScope['org.springframework.web.context.WebApplicationContext.ROOT']}
org.apache.AnnotationProcessororg.apache.catalina.util.DefaultAnnotationProcessororg.apache.catalina.util.DefaultAnnotationProcessor@bdec44${applicationScope['org.apache.AnnotationProcessor']}
org.apache.myfaces.shared_impl.webapp.webxml.WebXmlorg.apache.myfaces.shared_impl.webapp.webxml.WebXmlorg.apache.myfaces.shared_impl.webapp.webxml.WebXml@e29f36${applicationScope['org.apache.myfaces.shared_impl.webapp.webxml.WebXml']}
org.apache.catalina.WELCOME_FILESjava.lang.String[2][index.jsp, index.html]${applicationScope['org.apache.catalina.WELCOME_FILES']}
__oscache_admincom.opensymphony.oscache.web.ServletCacheAdministratorcom.opensymphony.oscache.web.ServletCacheAdministrator@1be996d${applicationScope['__oscache_admin']}
org.springframework.web.servlet.FrameworkServlet.CONTEXT.springorg.springframework.web.context.support.XmlWebApplicationContextorg.springframework.web.context.support.XmlWebApplicationContext: display name [WebApplicationConte...${applicationScope['org.springframework.web.servlet.FrameworkServlet.CONTEXT.spring']}
org.apache.myfaces.webapp.StartupServletContextListener.FACES_INIT_DONEjava.lang.Booleantrue${applicationScope['org.apache.myfaces.webapp.StartupServletContextListener.FACES_INIT_DONE']}
wtfigo.oscache.monitororg.wtfigo.controller.ViewOSCache$OSCacheMonitorStatisticListenerImpl: Hit = 0 / 0, stale hit = 0 / 0, miss = 0 / 0, flush = 0${applicationScope['wtfigo.oscache.monitor']}
org.apache.catalina.resourcesorg.apache.naming.resources.ProxyDirContextorg.apache.naming.resources.ProxyDirContext@10a0d51${applicationScope['org.apache.catalina.resources']}
org.apache.catalina.jsp_classpathjava.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.tempdirjava.io.File/opt/wtftomcat/work/Catalina/localhost/wtfigo-demo${applicationScope['javax.servlet.context.tempdir']}
org.springframework.web.servlet.FrameworkServlet.CONTEXT.itemlistorg.springframework.web.context.support.XmlWebApplicationContextorg.springframework.web.context.support.XmlWebApplicationContext: display name [WebApplicationConte...${applicationScope['org.springframework.web.servlet.FrameworkServlet.CONTEXT.itemlist']}

Session Scope:
Usage: ${sessionScope.KEY} or ${sessionScope['KEY']}

KeyClassValueJSTL EL
mySessionScopedBeanorg.wtfigo.demo.pojo.SampleBean1SampleBean1: string1=String1;string2=String2;map={key1=value1, key3=value3, key2=value2};sampleBean...${sessionScope['mySessionScopedBean']}

Request Scope:
Usage: ${requestScope.KEY} or ${requestScope['KEY']}

KeyClassValueJSTL EL
myRequestScopedBeanorg.wtfigo.demo.pojo.SampleBean1SampleBean1: string1=String1;string2=String2;map={key1=value1, key3=value3, key2=value2};sampleBean...${requestScope['myRequestScopedBean']}
ReqFilter.FILTEREDjava.lang.Booleantrue${requestScope['ReqFilter.FILTERED']}

Page Scope:
Usage: ${pageScope.KEY} or ${pageScope['KEY']}

KeyClassValueJSTL EL
javax.servlet.jsp.jspApplicationorg.apache.catalina.core.ApplicationContextFacadeorg.apache.catalina.core.ApplicationContextFacade@12c5431${pageScope['javax.servlet.jsp.jspApplication']}
javax.servlet.jsp.jspPageorg.apache.jsp.demo.tagAttributes_jsporg.apache.jsp.demo.tagAttributes_jsp@fde7ba${pageScope['javax.servlet.jsp.jspPage']}
javax.servlet.jsp.jspSessionorg.apache.catalina.session.StandardSessionFacadeorg.apache.catalina.session.StandardSessionFacade@de24c5${pageScope['javax.servlet.jsp.jspSession']}
javax.servlet.jsp.jspResponseorg.apache.catalina.connector.ResponseFacadeorg.apache.catalina.connector.ResponseFacade@402e11${pageScope['javax.servlet.jsp.jspResponse']}
javax.servlet.jsp.jspOutorg.apache.jasper.runtime.JspWriterImplorg.apache.jasper.runtime.JspWriterImpl@1906773${pageScope['javax.servlet.jsp.jspOut']}
javax.servlet.jsp.jspPageContextorg.apache.jasper.runtime.PageContextImplorg.apache.jasper.runtime.PageContextImpl@177c977${pageScope['javax.servlet.jsp.jspPageContext']}
javax.servlet.jsp.jspConfigorg.apache.catalina.core.StandardWrapperFacadeorg.apache.catalina.core.StandardWrapperFacade@17a6686${pageScope['javax.servlet.jsp.jspConfig']}
javax.servlet.jsp.jspRequestorg.apache.catalina.connector.RequestFacadeorg.apache.catalina.connector.RequestFacade@8e2fb5${pageScope['javax.servlet.jsp.jspRequest']}