New to JSP and need Help!

[nobr]I am running Apache 5.5.17 on an XP system.

I am trying to run a bean (which is part of a tutorial online). I have compiled it and placed it in the folder where the jsp files are. (C:\Program Files\Apache Software Foundation\Tomcat 5.5\webapps\jsp-examples\test)

I am new to JSP so sorry if this problem is basic.

Thanks

Harold

Error:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfillingthis request.

exception

org.apache.jasper.JasperException: /test/SaveName.jsp(1,1) The valuefor the useBeanclass attribute UserData is invalid.

org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

root cause

org.apache.jasper.JasperException: /test/SaveName.jsp(1,1) The valuefor the useBeanclass attribute UserData is invalid.

org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)

org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)

org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)

org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1174)

org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)

org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)

org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)

org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)

org.apache.jasper.compiler.Node$Root.accept(Node.java:456)

org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)

org.apache.jasper.compiler.Generator.generate(Generator.java:3305)

org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:198)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:295)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)

org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)

org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)

javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

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>

SaveName.jsp

<jsp:useBean id="user" class="UserData" scope="session"/>

<jsp:setProperty name="user" property="*"/>

<HTML>

<BODY>

<A HREF="NextPage.jsp">Continue</A>

</BODY>

</HTML>

NextPage.jsp

<jsp:useBean id="user" class="UserData" scope="session"/>

<HTML>

<BODY>

You entered<BR>

Name: <%= user.getUsername() %><BR>

Email: <%= user.getEmail() %><BR>

Age: <%= user.getAge() %><BR>

</BODY>

</HTML>

UserData.java

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;}

}

[/nobr]

[5783 byte] By [haroldclementsa] at [2007-11-26 12:58:13]
# 1
ummm.. probably class="UserData" should be type="user.UserData"
jgalacambraa at 2007-7-7 16:55:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
please put your class file in the class folder.The try again
shiju707a at 2007-7-7 16:55:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
hello if u got the answer for this please tell i also need the same
codename47a at 2007-7-7 16:55:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
You're missing the package name."UserData" != "user.UserData"
BalusCa at 2007-7-7 16:55:27 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...