org.apache.struts.taglib.html
Class OptionTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by javax.servlet.jsp.tagext.BodyTagSupport
          extended by org.apache.struts.taglib.html.OptionTag
All Implemented Interfaces:
Serializable, BodyTag, IterationTag, Tag

public class OptionTag
extends BodyTagSupport

Tag for select options. The body of this tag is presented to the user in the option list, while the value attribute is the value returned to the server if this option is selected.

Version:
$Rev: 479633 $ $Date: 2005-08-21 19:08:45 -0400 (Sun, 21 Aug 2005) $
See Also:
Serialized Form

Field Summary
protected  String bundle
          The name of the servlet context attribute containing our message resources.
protected  boolean disabled
          Is this option disabled?
protected  boolean filter
          Should the label be filtered for HTML sensitive characters?
protected  String key
          The key used to look up the text displayed to the user for this option, if any.
protected  String locale
          The name of the attribute containing the Locale to be used for looking up internationalized messages.
protected static org.apache.struts.util.MessageResources messages
          The message resources for this package.
protected  String styleId
          The identifier associated with this tag.
protected  String text
          The message text to be displayed to the user for this tag (if any)
protected  String value
          The server value for this option, also used to match against the current property value to determine whether this option should be marked as selected.
 
Fields inherited from class javax.servlet.jsp.tagext.BodyTagSupport
bodyContent
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
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
OptionTag()
           
 
Method Summary
 int doAfterBody()
          Process the body text of this tag (if any).
 int doEndTag()
          Process the end of this tag.
 int doStartTag()
          Process the start of this tag.
 String getBundle()
           
 String getDir()
          Returns the direction for weak/neutral text this element.
 boolean getDisabled()
           
 boolean getFilter()
           
 String getKey()
           
 String getLang()
          Returns the language code of this element.
 String getLocale()
           
 String getStyle()
           
 String getStyleClass()
           
 String getStyleId()
          Return the style identifier for this tag.
 String getValue()
           
 void release()
          Release any acquired resources.
protected  String renderOptionElement()
          Generate an HTML %lt;option> element.
 void setBundle(String bundle)
           
 void setDir(String dir)
          Sets the direction for weak/neutral text of this element.
 void setDisabled(boolean disabled)
           
 void setFilter(boolean filter)
           
 void setKey(String key)
           
 void setLang(String lang)
          Sets the language code of this element.
 void setLocale(String locale)
           
 void setStyle(String style)
           
 void setStyleClass(String styleClass)
           
 void setStyleId(String styleId)
          Set the style identifier for this tag.
 void setValue(String value)
           
protected  String text()
          Return the text to be displayed to the user for this option (if any).
 
Methods inherited from class javax.servlet.jsp.tagext.BodyTagSupport
doInitBody, getBodyContent, getPreviousOut, setBodyContent
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
getParent, setPageContext, setParent
 

Field Detail

messages

protected static org.apache.struts.util.MessageResources messages
The message resources for this package.


text

protected String text
The message text to be displayed to the user for this tag (if any)


bundle

protected String bundle
The name of the servlet context attribute containing our message resources.


disabled

protected boolean disabled
Is this option disabled?


filter

protected boolean filter
Should the label be filtered for HTML sensitive characters?


key

protected String key
The key used to look up the text displayed to the user for this option, if any.


locale

protected String locale
The name of the attribute containing the Locale to be used for looking up internationalized messages.


styleId

protected String styleId
The identifier associated with this tag.


value

protected String value
The server value for this option, also used to match against the current property value to determine whether this option should be marked as selected.

Constructor Detail

OptionTag

public OptionTag()
Method Detail

getBundle

public String getBundle()

setBundle

public void setBundle(String bundle)

getDisabled

public boolean getDisabled()

setDisabled

public void setDisabled(boolean disabled)

getFilter

public boolean getFilter()

setFilter

public void setFilter(boolean filter)

getKey

public String getKey()

setKey

public void setKey(String key)

getLocale

public String getLocale()

setLocale

public void setLocale(String locale)

getStyle

public String getStyle()

setStyle

public void setStyle(String style)

getStyleClass

public String getStyleClass()

setStyleClass

public void setStyleClass(String styleClass)

getStyleId

public String getStyleId()
Return the style identifier for this tag.


setStyleId

public void setStyleId(String styleId)
Set the style identifier for this tag.

Parameters:
styleId - The new style identifier

getValue

public String getValue()

setValue

public void setValue(String value)

getLang

public String getLang()
Returns the language code of this element.

Since:
Struts 1.3.6

setLang

public void setLang(String lang)
Sets the language code of this element.

Since:
Struts 1.3.6

getDir

public String getDir()
Returns the direction for weak/neutral text this element.

Since:
Struts 1.3.6

setDir

public void setDir(String dir)
Sets the direction for weak/neutral text of this element.

Since:
Struts 1.3.6

doStartTag

public int doStartTag()
               throws JspException
Process the start of this tag.

Specified by:
doStartTag in interface Tag
Overrides:
doStartTag in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

doAfterBody

public int doAfterBody()
                throws JspException
Process the body text of this tag (if any).

Specified by:
doAfterBody in interface IterationTag
Overrides:
doAfterBody in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

doEndTag

public int doEndTag()
             throws JspException
Process the end of this tag.

Specified by:
doEndTag in interface Tag
Overrides:
doEndTag in class BodyTagSupport
Throws:
JspException - if a JSP exception has occurred

renderOptionElement

protected String renderOptionElement()
                              throws JspException
Generate an HTML %lt;option> element.

Throws:
JspException
Since:
Struts 1.1

release

public void release()
Release any acquired resources.

Specified by:
release in interface Tag
Overrides:
release in class BodyTagSupport

text

protected String text()
               throws JspException
Return the text to be displayed to the user for this option (if any).

Throws:
JspException - if an error occurs


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.