com.taggercat.tags
Class CrumbTrailTag

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

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

This tag is used to create a page navigation crumb trail. This tag has a combined function of adding the current page (tag) to the crumb trail, as well as printing out the crumb trail.

Crumbs are unique by their caption.

This tag uses two context init parameters for additional information.

  1. crumbTrailFormat - the format string of the link to create
  2. crumbTrailSeparator - the crumb separator text

The actual anchor tag, or href that is created for each crumb is defined in the crumbTrailFormat string, or by setting the href attribute.

Because the crumbTrailFormat string is externalized, crumbs can be made up of any content needed.

When the crumb trail is created, each link will contain the name of the response page where the crumb was defined.

However, all crumbs will use the error page defined in the current page's crumb.

Correspondingly, all crumbs will use the DSN defined in the current page's crumb.

Therefore, all crumb trail actions can be used to invoke an action (such as save) on the current page's data source prior to navigating to the destination page.

See Also:
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
CrumbTrailTag()
           
 
Method Summary
 int doEndTag()
          Resets the tags internal state.
 int doStartTag()
          Create the crumb trail, add this tag to the list if needed.
 boolean isReset()
           
 void setCaption(java.lang.String caption)
          Sets the default caption string.
 void setDsn(java.lang.String dsn)
          Set the name of the data source actions on this page could apply to.
 void setErrorPage(java.lang.String errorPage)
          Sets the error page.
 void setHref(java.lang.String href)
          Sets the href format string for this tag's crumb trail, overriding the value of the crumbTrailFormat value set in the application's deployment descriptor.
 void setReset(boolean reset)
           
 void setResponsePage(java.lang.String responsePage)
          Sets the resulting response page, usually the current page.
 
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

CrumbTrailTag

public CrumbTrailTag()
Method Detail

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

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Create the crumb trail, add this tag to the list if needed.

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

setCaption

public void setCaption(java.lang.String caption)
Sets the default caption string.

Parameters:
caption - the new default caption value

setDsn

public void setDsn(java.lang.String dsn)
Set the name of the data source actions on this page could apply to.

Parameters:
dsn - the data source name

setErrorPage

public void setErrorPage(java.lang.String errorPage)
Sets the error page. This can be references with a {2} placeholder within the href handler.

Parameters:
errorPage - the resulting errorPage page

setHref

public void setHref(java.lang.String href)
Sets the href format string for this tag's crumb trail, overriding the value of the crumbTrailFormat value set in the application's deployment descriptor.

Valid placeholders are:

Parameters:
href - the href format string

setResponsePage

public void setResponsePage(java.lang.String responsePage)
Sets the resulting response page, usually the current page.

Parameters:
responsePage - the resulting response page, usually the current page

isReset

public boolean isReset()

setReset

public void setReset(boolean reset)