Saturday, December 02, 2006

JSTL <c:set> Tag

Sets values for variables.
: (Core)
Prefix: c
value | * = value to set.
var | String = variable holding the value. If not used, target/property MUST be used.
scope | String = scope for var e.g. page, session, request, or application.
target | JavaBean object, Map = collection or bean specified by 'property' below.
property | String = name of the target above.
<c:set var="pizzaSelected" value="true" />


Anonymous said...

can you please tell me how can i use var="pizzaSelected" value in my jquery function

Anonymous said...

in your jsp type:


where my_div_id is the id from a div that should contain the value from "pizzaSelected"

interview questions JSP said...

Another useful point is that if value is long enough to fit in attribute we can provide it in the body of set tag. See here for more examples of set tag in JSTL