public class OptionsTag
extends javax.servlet.jsp.tagext.TagSupport
Modifier and Type | Field and Description |
---|---|
protected String |
collection
The name of the collection containing beans that have properties to
provide both the values and the labels (identified by the
property and labelProperty attributes). |
protected boolean |
filter
Should the label values be filtered for HTML sensitive characters?
|
protected String |
labelName
The name of the bean containing the labels collection.
|
protected String |
labelProperty
The bean property containing the labels collection.
|
protected static MessageResources |
messages
The message resources for this package.
|
protected String |
name
The name of the bean containing the values collection.
|
protected String |
property
The name of the property to use to build the values collection.
|
Constructor and Description |
---|
OptionsTag() |
Modifier and Type | Method and Description |
---|---|
protected void |
addOption(StringBuffer sb,
String value,
String label,
boolean matched)
Add an option element to the specified StringBuffer based on the
specified parameters.
|
int |
doEndTag()
Process the end of this tag.
|
int |
doStartTag()
Process the start of this tag.
|
String |
getCollection() |
boolean |
getFilter() |
protected Iterator |
getIterator(String name,
String property)
Return an iterator for the option labels or values, based on our
configured properties.
|
String |
getLabelName() |
String |
getLabelProperty() |
String |
getName() |
String |
getProperty() |
String |
getStyle() |
String |
getStyleClass() |
void |
release()
Release any acquired resources.
|
void |
setCollection(String collection) |
void |
setFilter(boolean filter) |
void |
setLabelName(String labelName) |
void |
setLabelProperty(String labelProperty) |
void |
setName(String name) |
void |
setProperty(String property) |
void |
setStyle(String style) |
void |
setStyleClass(String styleClass) |
protected static MessageResources messages
protected String collection
property
and labelProperty
attributes).protected boolean filter
protected String labelName
protected String labelProperty
protected String name
protected String property
public String getCollection()
public void setCollection(String collection)
public boolean getFilter()
public void setFilter(boolean filter)
public String getLabelName()
public void setLabelName(String labelName)
public String getLabelProperty()
public void setLabelProperty(String labelProperty)
public String getName()
public void setName(String name)
public String getProperty()
public void setProperty(String property)
public String getStyle()
public void setStyle(String style)
public String getStyleClass()
public void setStyleClass(String styleClass)
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic int doEndTag() throws javax.servlet.jsp.JspException
doEndTag
in interface javax.servlet.jsp.tagext.Tag
doEndTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
- if a JSP exception has occurredpublic void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.TagSupport
protected void addOption(StringBuffer sb, String value, String label, boolean matched)
Note that this tag specifically does not
support the styleId
tag attribute, which causes the HTML
id
attribute to be emitted. This is because the HTML
specification states that all "id" attributes in a document have to be
unique. This tag will likely generate more than one
option
element element, but it cannot use the same
id
value. It's conceivable some sort of mechanism to
supply an array of id
values could be devised, but that
doesn't seem to be worth the trouble.
sb
- StringBuffer accumulating our resultsvalue
- Value to be returned to the server for this optionlabel
- Value to be shown to the user for this optionmatched
- Should this value be marked as selected?protected Iterator getIterator(String name, String property) throws javax.servlet.jsp.JspException
name
- Name of the bean attribute (if any)property
- Name of the bean property (if any)javax.servlet.jsp.JspException
- if an error occursCopyright © 2000–2017 Apache Software Foundation. All rights reserved.