Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

HFS pg 447 doubt.

Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
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 ?

Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 "."

That is a really big piece of pie for such a tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic