net.sourceforge.stripes.tag
Class WizardFieldsTag

java.lang.Object
  extended by net.sourceforge.stripes.tag.StripesTagSupport
      extended by net.sourceforge.stripes.tag.WizardFieldsTag
All Implemented Interfaces:
JspTag, Tag, TryCatchFinally

public class WizardFieldsTag
extends StripesTagSupport
implements TryCatchFinally

Examines the request and include hidden fields for all parameters that have do not have form fields in the current form. Will include multiple values for parameters that have them. Excludes 'special' parameters like the source page parameter, and the parameter that conveyed the event name.

Very useful for implementing basic wizard flow without relying on session scoping of ActionBeans, and without having to name all the parameters that should be carried forward in the form.

Author:
Tim Fennell

Field Summary
 
Fields inherited from class net.sourceforge.stripes.tag.StripesTagSupport
pageContext, parentTag
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
WizardFieldsTag()
           
 
Method Summary
 void doCatch(Throwable throwable)
          Rethrows the passed in throwable in all cases.
 int doEndTag()
          Performs the main work of the tag, as described in the class level javadoc.
 void doFinally()
          Used to ensure that the input tag is always removed from the tag stack so that there is never any confusion about tag-parent hierarchies.
 int doStartTag()
          Skips over the body because there shouldn't be one.
 boolean isCurrentFormOnly()
          Gets whether the tag will output fields for the current form only, or in all cases.
protected  boolean isEventName(Class<? extends ActionBean> beanType, String name)
          Returns true if name is the name of an event handled by ActionBeans of type beanType.
 void setCurrentFormOnly(boolean currentFormOnly)
          Sets whether or not the parameters should be output only if the form matches the current request.
 
Methods inherited from class net.sourceforge.stripes.tag.StripesTagSupport
getActionBeanType, getActionBeanUrl, getPageContext, getParent, getParentTag, getTagStack, popPageContextAttributes, pushPageContextAttributes, release, setPageContext, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WizardFieldsTag

public WizardFieldsTag()
Method Detail

setCurrentFormOnly

public void setCurrentFormOnly(boolean currentFormOnly)
Sets whether or not the parameters should be output only if the form matches the current request. Defaults to false.


isCurrentFormOnly

public boolean isCurrentFormOnly()
Gets whether the tag will output fields for the current form only, or in all cases.


doStartTag

public int doStartTag()
               throws JspException
Skips over the body because there shouldn't be one.

Specified by:
doStartTag in interface Tag
Specified by:
doStartTag in class StripesTagSupport
Throws:
JspException

doEndTag

public int doEndTag()
             throws JspException
Performs the main work of the tag, as described in the class level javadoc.

Specified by:
doEndTag in interface Tag
Specified by:
doEndTag in class StripesTagSupport
Returns:
EVAL_PAGE in all cases.
Throws:
JspException

doCatch

public void doCatch(Throwable throwable)
             throws Throwable
Rethrows the passed in throwable in all cases.

Specified by:
doCatch in interface TryCatchFinally
Throws:
Throwable

doFinally

public void doFinally()
Used to ensure that the input tag is always removed from the tag stack so that there is never any confusion about tag-parent hierarchies.

Specified by:
doFinally in interface TryCatchFinally

isEventName

protected boolean isEventName(Class<? extends ActionBean> beanType,
                              String name)
Returns true if name is the name of an event handled by ActionBeans of type beanType.

Parameters:
beanType - An ActionBean class
name - The name to look up


? Copyright 2005-2006, Stripes Development Team.