• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

When Dot or [ ] Throw Exception

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Since there's lots of questions scattered:
According to the Spec.
El dot only throws Exception if myBean and myBeanProperty are not null, but getMyBeanProperty() doesn't exist in MyBean Class.
(Also if Exception thrown by getter itself)

This is only a problem for beans.


Sorry, the arrangement of the list isn't clear here. See the spec.

JavaServer Pages 2.0 Specification
General Syntax of the Expression Language
pp 1-68


[ February 23, 2005: Message edited by: P. Dunn ]
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mr Dunn,
That is a useful information.

Here I assume all the values which are evaluated as null will be outputted to JSP as empty value ""

Now look at the quote from above.
--------------
� Otherwise (a JavaBeans object), coerce value-b to String
- If value-b is a readable property of value-a as per the JavaBeans specification:
- If getter throws an exception: error
- Otherwise: return result of getter call
- Otherwise: error.
------------
This means that there is only two possibility available with JavaBeans . either return getter value or throw error.
In case value-a is null then the return value will be null.(thats the third option )
 
P. Dunn
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ranjit Jana:
Mr Dunn,
That is a useful information.
...This means that there is only two possibility available with JavaBeans . either return getter value or throw error.
In case value-a is null then the return value will be null.(thats the third option )



If either a or b are null you get null back.

(How'd you know I was Mr. Dunn?
 
Nothing? Or something? Like this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic