net.sourceforge.stripes.tag
Class PageOptionsTag

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

public class PageOptionsTag
extends StripesTagSupport

Provides a tag to override the StripesFilter configuration property Stripes.HtmlMode.

htmlMode accepts any string value, however any value not equal to html, case-insensitive, puts Stripes into its default mode of XHTML-compatible output.

Examples of the tag's use then might be:

Typical use of the tag in context of a Stripes application follows:

Deployer will set the application RuntimeConfiguration of Stripes.HtmlMode. A deployer choosing not to set this option, defaults the Stripes application to its XHTML-compatible format.

Stripes.HtmlMode will set the default X/HTML output for the entire application. Individual views of the application wishing to alter the application default will provide this tag, at or near the beginning of the view, or JSP.

Since:
1.5.5
Author:
Timothy Stone

Field Summary
static String CFG_KEY_HTML_MODE
          Configuration key that sets the default HTML mode for the application.
static String REQ_ATTR_HTML_MODE
          Request attribute that affects how HTML is rendered by other tags.
 
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
PageOptionsTag()
           
 
Method Summary
 int doEndTag()
          Abstract method from the Tag interface.
 int doStartTag()
          Abstract method from the Tag interface.
static String getHtmlMode(PageContext pageContext)
          Get the HTML mode for the given page context.
 void setHtmlMode(String htmlMode)
          Set the HTML mode string.
 
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
 

Field Detail

CFG_KEY_HTML_MODE

public static String CFG_KEY_HTML_MODE
Configuration key that sets the default HTML mode for the application.


REQ_ATTR_HTML_MODE

public static String REQ_ATTR_HTML_MODE
Request attribute that affects how HTML is rendered by other tags.

Constructor Detail

PageOptionsTag

public PageOptionsTag()
Method Detail

getHtmlMode

public static String getHtmlMode(PageContext pageContext)
Get the HTML mode for the given page context. If the request attribute REQ_ATTR_HTML_MODE is present then use that value. Otherwise, use the global configuration property CFG_KEY_HTML_MODE.


doStartTag

public int doStartTag()
               throws JspException
Description copied from class: StripesTagSupport
Abstract method from the Tag interface. Abstract because it seems to make the child tags more readable if they implement their own do() methods, even when they just return one of the constants and do nothing else.

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

doEndTag

public int doEndTag()
             throws JspException
Description copied from class: StripesTagSupport
Abstract method from the Tag interface. Abstract because it seems to make the child tags more readable if they implement their own do() methods, even when they just return one of the constants and do nothing else.

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

setHtmlMode

public void setHtmlMode(String htmlMode)
Set the HTML mode string.



© Copyright 2005-2006, Stripes Development Team.