|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.webwork.components.Component
com.opensymphony.webwork.components.Set
public class Set
The set tag assigns a value to a variable in a specified scope. It is useful when you wish to assign a variable to a complex expression and then simply reference that variable each time rather than the complex expression. This is useful in both cases: when the complex expression takes time (performance improvement) or is hard to read (code readability improvement).
The set tag accepts body. However the followings need to be take note when using set tag with body
<ww:set name="personName" value="person.name"/> Hello, <ww:property value="%{#personName}"/>. How are you? <ww:set name="personName"> <ww:property value="%{'some string'}" /> </ww:set> Hello, <ww:property value="%{#personName}"/>. How are you? <ww:set name="personName"> <c:set value="${person.name}" /> </ww:set> Hello, <ww:property value="%{#personName}"/>. How are you?
Field Summary | |
---|---|
protected String |
name
|
protected String |
scope
|
protected String |
value
|
Fields inherited from class com.opensymphony.webwork.components.Component |
---|
COMPONENT_STACK, id, parameters, stack |
Constructor Summary | |
---|---|
Set(OgnlValueStack stack)
|
Method Summary | |
---|---|
boolean |
end(Writer writer,
String body)
Callback for the end tag of this component. |
void |
setName(String name)
The name of the new variable that is assigned the value of value |
void |
setScope(String scope)
The scope in which to assign the variable. |
void |
setValue(String value)
The value that is assigned to the variable named name |
boolean |
usesBody()
Returns true, so that we use EVAL_BODY_BUFFERED instead of EVAL_BODY_INCLUDE |
Methods inherited from class com.opensymphony.webwork.components.Component |
---|
addAllParameters, addParameter, altSyntax, copyParams, determineActionURL, determineNamespace, end, fieldError, findAncestor, findString, findString, findValue, findValue, findValue, getComponentStack, getId, getParameters, getStack, popComponentStack, setId, start, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected String name
protected String scope
protected String value
Constructor Detail |
---|
public Set(OgnlValueStack stack)
Method Detail |
---|
public boolean usesBody()
usesBody
in class Component
Component.usesBody()
public boolean end(Writer writer, String body)
Component
end
in class Component
writer
- the output writer.body
- the rendered body.
public void setName(String name)
public void setScope(String scope)
public void setValue(String value)
|
WebWork Project Page | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |