Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Qn on EL

 
Chandrakanth
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

if we have in JSP like this
1. ${person.name}
2. ${person["name"]}

if the person class does not have a getName method, is it a exception or not.
 
Ed Ward
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I recall it will return null.
Try it out.
 
sagar jagirapu
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It will trow an exception



because first jsp will translate servlet ..
then that servlet should compile ... while compilation its cause error (i.e is servlet exception)
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

It will throw Exception as the property of bean does not exists. The the attribute person is itself not present in any scope, the it returns null and print nothing.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic