Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
  • Piet Souris
  • Himai Minh

HFS pg 447 doubt.

Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 "."

Cob is sand, clay and sometimes straw. This tiny ad is made of cob:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
    Bookmark Topic Watch Topic
  • New Topic