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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Clarification About c:set target= on bottom of p.447 of HFSJ Book

 
hangman
Posts: 220
Angular Framework Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ranchers;
I am having a hard time understanding what they are saying in the last part of the very last item in the black "Key Points and Gotchas with <c:set>" box. I can't get null when using a non-property in the EL, but I still get an exception, rather than a null value.

When I create the bean and use the <c:set> tag to set the property, it works fine.


This is fine because, then I get the output I expect:
We think the cats name is : Fluffy

But then when I added a line at the end of the JSP that says:
, then my app blows up with:
javax.servlet.ServletException: Unable to find a value for "junk" in object of class "CatBean" using operator "."

Thanks for any clarification as to what they are saying in this final bullet point.
 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
According to my notes I show that EL exceptions thrown during the evaluation of an EL expression choose to return null including when a nullpointer exception is thrown - combat this with the empty operator.

However, if a JavaBean property does not exist then an exception is thrown. That seems to jive with what you example did.

Kevin DesLauriers
 
Bob Nedwor
hangman
Posts: 220
Angular Framework Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But based on what they are saying at the bottom of p. 447, I should be able to generate the null, rather than throw an exception, using a non-Property under some condition, right?

I just cannot see how?
Thanks for any hints.
[ February 16, 2007: Message edited by: Bob Nedwor ]
 
That's a very big dog. I think I want to go home now and hug this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic