aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Unable to assign value to Bean property using jsp expression Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Unable to assign value to Bean property using jsp expression" Watch "Unable to assign value to Bean property using jsp expression" New topic
Author

Unable to assign value to Bean property using jsp expression

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634



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 ?


OCPJP 6.0 93%
OCPJWCD 5.0 98%
Haina Minawa
Ranch Hand

Joined: Oct 13, 2011
Posts: 119
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

Joined: Nov 09, 2009
Posts: 7
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

Joined: May 18, 2010
Posts: 634

Thanks Madhumitha
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Unable to assign value to Bean property using jsp expression