Forums Register Login

problem with <c:set> with a body syntax

+Pie Number of slices to send: Send
Please consider the following code written by me while studying HFSJ topic JSTL:


It produces the required output:
aa
bb
cc

Now i wrote another code to produce the same output using the <c:set> with a body:



but it produces the following output:

[Ljava.lang.String;@738a71


Can anyone tell me why is it ot taking the value of "users" from the body?
+Pie Number of slices to send: Send
The body is being evaluated and the resulting string is assigned to the variable. Using the value attribute and using the tag body are not interchangeable, and do not produce the same results.
+Pie Number of slices to send: Send
saima,

As usual .. Bear is right ... simply use value rather than the body content ... here's an example ... The issue is that c:set value uses the same type as the object retrieved by your EL expression ... in the body of the tag it calls toString() on the object retrieved ... at least that's my understanding ... see page 455 in K&B.

And inside of my fortune cookie was this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 1754 times.
Similar Threads
Nested C:forEach varStatus ??
How to get a connection from the connection pool in a servlet
EL expressions not evaluating
how to print values on jsp page fetched from servlet
EL/JSTL : Retrieving a Javabean from a List attribute
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 07:33:16.