Forums Register Login

HFS pg 447 doubt.

+Pie Number of slices to send: Send
Hello Ranchers,

HFS pg. 447, key point and gotchas for the <c:set>

If the "target" expression is a bean, but the bean does not have a property that matches "property", the Container throws an exception. But be careful, because the EL expression by itself will NOT cause an exception, if the property doesn't exist.



Why NOT ? EL will not forgive u for this...

if i do something like this:
${fooBean.notAProperty}
it WILL cause me an exception. Tested this with Tomcat5.0.28 also. There was an exception.

am i missing something, or is it an error in the book here ?

Regards,
Gaurav.
+Pie Number of slices to send: Send
There's another possibility that Tomcat is not doing what it should be.

I agree with you, though, that something bad happens in Tomcat when using the dot operator on something thats not there. In some code I had open, I changed "${listElement.shipComment}" to "${listElement.nonExisting}" and it blew sky-high:

Servlet.service() for servlet jsp threw exception javax.servlet.jsp.el.ELException: Unable to find a value for "nonExisting" in object of class "xabookstore.entity.Item" using operator "."

--Dale--
knowledge is the difference between drudgery and strategic action -- tiny ad
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 646 times.
Similar Threads
EL and missing properties
Doubt from HFSJ - Using JSTL
jstl set tag
Possible error on HFS and errata
Bean Property-Dot Operator..
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 03:21:41.