org.apache.struts.taglib.html

Class SelectTag

public class SelectTag extends BaseHandlerTag

Custom tag that represents an HTML select element, associated with a bean property specified by our attributes. This tag must be nested inside a form tag.

Version: $Rev: 54929 $ $Date: 2004-10-16 17:38:42 +0100 (Sat, 16 Oct 2004) $

Field Summary
protected String[]match
The actual values we will match against, calculated in doStartTag().
protected static MessageResourcesmessages
The message resources for this package.
protected Stringmultiple
Should multiple selections be allowed.
protected Stringname
The name of the bean containing our underlying property.
protected Stringproperty
The property name we are associated with.
protected StringsaveBody
The saved body content of this tag.
protected Stringsize
How many available options should be displayed when this element is rendered?
protected Stringvalue
The value to compare with for marking an option selected.
Method Summary
voidcalculateMatchValues()
Calculate the match values we will actually be using.
intdoAfterBody()
Save any body content of this tag, which will generally be the option(s) representing the values displayed to the user.
intdoEndTag()
Render the end of this form.
intdoStartTag()
Render the beginning of this select tag.
StringgetMultiple()
StringgetName()
StringgetProperty()
Return the property name.
StringgetSize()
StringgetValue()
Return the comparison value.
booleanisMatched(String value)
Does the specified value match one of those we are looking for?
protected StringprepareName()
Prepare the name element
voidrelease()
Release any acquired resources.
protected StringrenderSelectStartElement()
Create an appropriate select start element based on our parameters.
voidsetMultiple(String multiple)
voidsetName(String name)
voidsetProperty(String property)
Set the property name.
voidsetSize(String size)
voidsetValue(String value)
Set the comparison value.

Field Detail

match

protected String[] match
The actual values we will match against, calculated in doStartTag().

messages

protected static MessageResources messages
The message resources for this package.

multiple

protected String multiple
Should multiple selections be allowed. Any non-null value will trigger rendering this.

name

protected String name
The name of the bean containing our underlying property.

property

protected String property
The property name we are associated with.

saveBody

protected String saveBody
The saved body content of this tag.

size

protected String size
How many available options should be displayed when this element is rendered?

value

protected String value
The value to compare with for marking an option selected.

Method Detail

calculateMatchValues

private void calculateMatchValues()
Calculate the match values we will actually be using.

Throws: JspException

doAfterBody

public int doAfterBody()
Save any body content of this tag, which will generally be the option(s) representing the values displayed to the user.

Throws: JspException if a JSP exception has occurred

doEndTag

public int doEndTag()
Render the end of this form.

Throws: JspException if a JSP exception has occurred

doStartTag

public int doStartTag()
Render the beginning of this select tag.

Support for indexed property since Struts 1.1

Throws: JspException if a JSP exception has occurred

getMultiple

public String getMultiple()

getName

public String getName()

getProperty

public String getProperty()
Return the property name.

getSize

public String getSize()

getValue

public String getValue()
Return the comparison value.

isMatched

public boolean isMatched(String value)
Does the specified value match one of those we are looking for?

Parameters: value Value to be compared.

prepareName

protected String prepareName()
Prepare the name element

Returns: The element name.

release

public void release()
Release any acquired resources.

renderSelectStartElement

protected String renderSelectStartElement()
Create an appropriate select start element based on our parameters.

Throws: JspException

Since: Struts 1.1

setMultiple

public void setMultiple(String multiple)

setName

public void setName(String name)

setProperty

public void setProperty(String property)
Set the property name.

Parameters: property The new property name

setSize

public void setSize(String size)

setValue

public void setValue(String value)
Set the comparison value.

Parameters: value The new comparison value

Copyright B) 2000-2009 - The Apache Software Foundation