The value for the useBean class attribute ... is invalid
62,269
Solution 1
You should put the file under WEBINF/classes/user
Solution 2
3 things
- Make sure the class file is under WEBINF/classes/user
- Make sure there is a public default constructor without arguments
- You can also use type= instead of class= if the bean already exists in the scope
Solution 3
Make sure that the default no-arg constructor is there and is public.
Related videos on Youtube
Author by
user62835
Updated on July 09, 2022Comments
-
user62835 almost 2 years
I want to use a Java file
SaveProp
which is written in a packageuser
. The class file has been placed inWEBINF/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.
-
atom88 over 9 yearsThank you very much! This saved the day!
-
Joshua Stafford over 8 yearswhich file goes in that folder? the .java, .class, .war?