com.taggercat.tags
Class ClientScopeTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.taggercat.tags.ClientScopeTag
All Implemented Interfaces:
java.io.Serializable, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class ClientScopeTag
extends javax.servlet.jsp.tagext.TagSupport

This tag is use to place an object into client scope by serializing it out to the page in a hidden form element. When a form with the serialized object is submitted, the object will automatically be recreated as an attribute on the named scope.

This tag is primarily intended to be used to maintain object state via the browser's page. You can use this to reduce the amount of state information saved into user session objects.

Another common use case for it is in maintaining a separate crumb trail for each browser window that a user might open when navigating your application. To enable this, include the following tag within the form element.

<tc:clientScope name="tc.crumbtrail" object="${sessionScope['tc.crumbtrail']}" scope="session" />

See Also:
AbstractRequestController.deserializeParameterObjects(HttpServletRequest), Serialized Form
 

Field Summary
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
ClientScopeTag()
           
 
Method Summary
 int doEndTag()
          Resets the tags internal state.
 int doStartTag()
          Processes the tag.
 java.lang.String getName()
           
 java.lang.Object getObject()
           
 java.lang.String getScope()
           
 void setName(java.lang.String name)
           
 void setObject(java.lang.Object object)
           
 void setScope(java.lang.String scope)
           
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
doAfterBody, findAncestorWithClass, getId, getParent, getValue, getValues, release, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClientScopeTag

public ClientScopeTag()
Method Detail

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Processes the tag.

Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspTagException
javax.servlet.jsp.JspException
Returns:
SKIP_BODY this tag does not create a body

doEndTag

public int doEndTag()
             throws javax.servlet.jsp.JspException
Resets the tags internal state.

Specified by:
doEndTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doEndTag in class javax.servlet.jsp.tagext.TagSupport
Throws:
javax.servlet.jsp.JspException
Returns:
EVAL_PAGE

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getObject

public java.lang.Object getObject()

setObject

public void setObject(java.lang.Object object)

getScope

public java.lang.String getScope()

setScope

public void setScope(java.lang.String scope)