|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
jp.terasoluna.fw.web.taglib.WriteCodeValueTag
public class WriteCodeValueTag
WriteCodeValue tag.
From the servlet context, search the CodeListLoader which is specified in codeList attribute, fetch the value from the stored codelist and output the value. When it is not found, nothing is output.
To read the code list, refer to the implementation class ofCodeListLoader
interface.
Attributes supported by tagwriteCodeValue tag supports the following attributes.
Attribute name | Default value | Required | Execution time format | Overview |
codeList |
- |
true |
true |
Searches CodeListLoader from this attribute. In other words, specify the name of bean which implements
CodeListLoader
interface.
|
key |
- |
false |
true |
Directly specify the key to fetch the value from the retreived code list. |
name |
- |
false |
true |
Name of the Bean that retains the key to fetch the value from the retrieved code list. It is invalid when key attribute is specified. |
property |
- |
false |
true |
Property of Bean that retains the key to fetch the value from the retrieved code list. It is invalid when key attribute is specified. |
scope |
- |
false |
true |
This is the scope in which Bean exists. The Bean retains the key to fetch the value from the retreived code list. |
There is no scripting variable which is set by this tag.
In the following example, bean of the class that implements CodeListLoader
,is defined with the name as "loader1".
The configuration example to fetch and output the value by using the
key named as "key1" is also shown.
For the method of defining the bean, refer to
DBCodeListLoader
,
and
MappedCodeListLoader
.
<t:writeCodeValue codeList="loader1" key="key1" />
To fetch the code list size, refer to WriteCodeCountTag
.
CodeListLoader
,
DBCodeListLoader
,
MappedCodeListLoader
,
DefineCodeListTag
,
WriteCodeCountTag
,
Serialized FormField Summary | |
---|---|
private java.lang.String |
codeList
Code list name. |
private java.lang.String |
key
Key to fetch the value from the code list. |
private static org.apache.commons.logging.Log |
log
Log class. |
private java.lang.String |
name
Name of the Bean to retreive the value specified in property. |
private java.lang.String |
property
Property name which is accessed in the Bean. This Bean is specified in name attribute. |
private java.lang.String |
scope
Search scope to fetch the bean that is specified in name attribute. |
private static long |
serialVersionUID
Serial version ID |
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
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 | |
---|---|
WriteCodeValueTag()
|
Method Summary | |
---|---|
int |
doEndTag()
Method which is called at the time of terminating the tag evaluation. |
int |
doStartTag()
Method which is called at the time of starting the tag evaluation. |
void |
release()
Process at the time of releasing the tag handler. |
void |
setCodeList(java.lang.String codeList)
Sets the code list name. |
void |
setKey(java.lang.String key)
Sets the key. |
void |
setName(java.lang.String name)
Sets the Bean name. |
void |
setProperty(java.lang.String property)
Sets the property name. |
void |
setScope(java.lang.String scope)
Sets the scope. |
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, 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 |
Field Detail |
---|
private static final long serialVersionUID
private static org.apache.commons.logging.Log log
private java.lang.String codeList
private java.lang.String key
private java.lang.String name
private java.lang.String property
private java.lang.String scope
Constructor Detail |
---|
public WriteCodeValueTag()
Method Detail |
---|
public void setName(java.lang.String name)
name
- Bean namepublic void setProperty(java.lang.String property)
property
- Property namepublic void setScope(java.lang.String scope)
scope
- Scopepublic void setKey(java.lang.String key)
key
- Code list keypublic void setCodeList(java.lang.String codeList)
codeList
- Code list namepublic int doStartTag() throws javax.servlet.jsp.JspException
From the servlet context, fetch the ApplicationContext. Fetch the CodeListLoader by the id which is specified in "codeList" attribute. Fetch the value from the code list and output the value. When the "key" attribute is specified, fetch the key value. When it is not specified, fetch the key from the bean which is specified in "name" attribute and use the key. When the code list is not found or when the key does not exist, nothing is output.
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
- JSP exceptionpublic 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
- JSP exceptionpublic void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.TagSupport
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |