The value for the useBean class attribute ... is invalid
[nobr]I keep getting this error:
The valuefor the useBeanclass attribute user.UserData is invalid.
I am using Tomcat 5.5
I am pretty sure that is has to do with my class path, but I don't know how to fix that.
here is my code:
http://localhost:8080/tutorial/GetName.html
<HTML>
<BODY>
<FORM METHOD=POST ACTION="SaveName.jsp">
What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20><BR>
What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20><BR>
What's your age? <INPUT TYPE=TEXT NAME=age SIZE=4>
<P><INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>
http://localhost:8080/tutorial/SaveName.jsp
<jsp:useBean id="user" class="user.UserData" scope="session"/>
<jsp:setProperty name="user" property="*"/>
<HTML>
<BODY>
<A HREF="NextPage.jsp">Continue</A>
</BODY>
</HTML>
http://localhost:8080/tutorial/NextPage.jsp
<jsp:useBean id="user" class="user.UserData" scope="session"/>
<HTML>
<BODY>
You entered<BR>
Name: <%= user.getUsername() %><BR>
Email: <%= user.getEmail() %><BR>
Age: <%= user.getAge() %><BR>
</BODY>
</HTML>
I know that that is not the easiest way of doing things, but I am following a JSP tutorial, and this is the code that was provided.
I also have the files UserData.class and UserData.java, but I do not know where to save them.
package user;
publicclass UserData{
String username;
String email;
int age;
publicvoid setUsername( String value )
{
username = value;
}
publicvoid setEmail( String value )
{
email = value;
}
publicvoid setAge(int value )
{
age = value;
}
public String getUsername(){return username;}
public String getEmail(){return email;}
publicint getAge(){return age;}
}
I'm pretty sure that is what is causing me all this trouble. I would appreciated any help or advice that you could give me on this issue.
Thanks in advance,
RH[/nobr]

