Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The value for the useBean class attribute ... is invalid [duplicate]

I want to use a Java file SaveProp which is written in a package user. The class file has been placed in WEBINF/classes. Below are the two lines which cause the issue.

jsp:useBean id="user" class="user.SaveProp" scope="session"

jsp:setProperty name="user" property="*"

It throws:

The value for the useBean class attribute user.SaveProp is invalid

I'm using Tomcat 6.0.

like image 691
user62835 Avatar asked Feb 13 '09 08:02

user62835


2 Answers

3 things

  1. Make sure the class file is under WEBINF/classes/user
  2. Make sure there is a public default constructor without arguments
  3. You can also use type= instead of class= if the bean already exists in the scope
like image 62
tiktock Avatar answered Nov 03 '22 13:11

tiktock


Make sure that the default no-arg constructor is there and is public.

like image 15
Monish Gandhi Avatar answered Nov 03 '22 11:11

Monish Gandhi