Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to assign value to Bean property using jsp expression

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


MyBean



Test2.jsp


TestBeans.jsp



Browser Output:

org.apache.jasper.JasperException: /Test2.jsp(2,0) The value for the useBean class attribute beansa.MyBean is invalid

myProperty is a Property of MyBean .Still,I am getting this exception .
How do I make the code work ?
 
Haina Minawa
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check if the MyBean class is compiled and present under WEB-INF\classes directory. This error means that the JVM could not found the class file.
 
Madhumitha Subramanian
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, a Bean cannot have constructor with arguments. The whole point of having setters is to set the property values through them and not using the constructor. Remove the constructor from the MyBean class and things should work.
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Madhumitha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic