• Post Reply Bookmark Topic Watch Topic
  • New Topic

The value for the useBean class attribute headsfirstjsp.beans.Person is invalid  RSS feed

 
Alexander Vogel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I am trying to use the following jsp. the first output works fine but the 2nd with standard action I got an error
( org.apache.jasper.JasperException: /personview.jsp(15,0) The value for the useBean class attribute headsfirstjsp.beans.Person is invalid ):


[ Bear: Edited to add code tags ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where did you place the class file for the Person class?
 
Alexander Vogel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Where did you place the class file for the Person class?


As the first output works fine, I think I put the class file in the right place:

...\WEB-INF\classes\headsfirstjsp\beans\Person.class
 
Karl San Gabriel
Greenhorn
Posts: 4
Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not really sure about the problem. But have you tried using just those
<jsp:getProperty .../>'s?
 
Alexander Vogel
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karl San Gabriel wrote:Not really sure about the problem. But have you tried using just those
<jsp:getProperty .../>'s?


I found the problem. The JavaBean to use must have a no-arg constructor and I had only a constructor with 2 parameters.
After I had added the no-arg-constructor the jsp works fine...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!