set tag
This tag sets a value into the processing stream with the given name. If the test attribute is used, the true or false value is supplied as the value based on the result of the test.
Attribute |
Notes |
name
|
Required
|
value
|
|
test
|
|
true
|
required if test is used
|
false
|
required if test is used
|
map
|
|
Sample:
<c:if test="${action eq 'rock'}">
<c:set name="display" value="none"/>
</c:if>
<div style="display:${display}">
Here is some text
</div>
<c:set name="width" test="${showBig}" true="100px" false="50px"/>
<div style="width:${width}">
Here is some text
</div>
<c:set name="${id}var" value="Something here"/>
<c:get name="${id}var"/>
<c:get name="${id}var" into="other"/> ${other}