Forums Register Login

How do I set this variable in JSTL?

+Pie Number of slices to send: Send
Hi,

I have three page attributes (hotels, motels, rvParks) that are all lists of the same object. Based on a JSTL loop variable, I want to set a generic attribute to represent one of these three. However, this code



turns the variable accommodations into something of type string instead of the java.util.List of objects that I want. How do I adjust the above so that the variable "accommodations" gets set to the same type as the attribute I'm referring to?

Thanks, - Dave
+Pie Number of slices to send: Send
Because the code is saying: "take the rendered body of the <c:set> tag and make it the value of the variable."

Rendered body will always be text.

Why aren't you handling this in the controller instead of doing hand-stands in the JSP?
+Pie Number of slices to send: Send
Do you know how to rewrite the c:set clause to set the attribute correctly instead of the string that is getting rendered? -
It's exactly the same and completely different as 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 1886 times.
Similar Threads
unwanted integer division
JSTL 1.1 - Get value from method of an Obj and set it to a variable
Color Table Rows Based on a Field Value
JSTL 1.0 - Get value of from an object when fn cannot be used
Conversion to JSTL - Help
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:58:50.