Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

access custom bean in EL

 
igor kvak
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i want to acces custom bean in jsp using expression language:


where empList is LinkedList<Employee> (stored this way: session.setAttribute("empList", list);)

i always get this error:
javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property 'getName'. (but according to the way how I store list, I dont know why is it stored as String)

thanks for help
 
Rajkumar balakrishnan
Ranch Hand
Posts: 445
Android Eclipse IDE Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by igor kvak:
hi
i want to acces custom bean in jsp using expression language:


where empList is LinkedList<Employee> (stored this way: session.setAttribute("empList", list)

i always get this error:
javax.el.PropertyNotFoundException: The class 'java.lang.String' does not have the property 'getName'. (but according to the way how I store list, I dont know why is it stored as String)

thanks for help

What the var emp means...?
Please post your servlet file and bean file...
 
igor kvak
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks, i finally solved it
mistake was in this line:

and the correct one is:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic