error on class attribute... pls. help!

[nobr]hi! i am beginning to learn jsp. i am using tomcat 5.5.20 and using some url i am learning over time bout jsp... only this, im having a very hard time figuring out the error i am getting.

HTTP Status 500 -

type Exception report

message

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

exception

org.apache.jasper.JasperException: /SaveName.jsp(1,1) The value for the useBean class attribute user.UserData is invalid.

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

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

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: /SaveName.jsp(1,1) The value for the useBean class attribute user.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:3320)

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:305)

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)

note The full stack trace of the root cause is available in the Apache Tomcat/5.5.20 logs.

i already compiled my UserData.java and stored the UserData.class in webapps/app-root/WEB-INF/classes and i already set my classpath also. here's my files:

GetName.html

<HTML>

<BODY>

<FORM METHOD=POST ACTION="SaveName.jsp">

What's your name? <INPUT TYPE=TEXT NAME=username SIZE=20>

What's your e-mail address? <INPUT TYPE=TEXT NAME=email SIZE=20>

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="user.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="user.UserData" scope="session"/>

<HTML>

<BODY>

You entered

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

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

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

</BODY>

</HTML>

--

pls. kindly help me with this... thanks a lot!!![/nobr]

[3959 byte] By [mfmondragona] at [2007-11-26 18:07:59]
# 1

hello

check ur bean naem. Every thing is fine but see the msg below.The attribute of the bean is invalid.

/SaveName.jsp(1,1) The value for the useBean class attribute user.UserData is invalid.

just check it again. or remove bean class and simple take the first html files parameter with

String name=request.getParameter("user")

String mail=request.getParameter("emailr")

then print the name and mail varibale with jsp Expression

then u will come to know .

and then try with bean

try it

bye

rakesh_thakura at 2007-7-9 5:39:31 > top of Java-index,Java Essentials,New To Java...
# 2

here's the code by the way

package user;

public class UserData {

String username;

String email;

int age;

public void setUsername( String value )

{

username = value;

}

public void setEmail( String value )

{

email = value;

}

public void setAge( int value )

{

age = value;

}

public String getUsername() { return username; }

public String getEmail() { return email; }

public int getAge() { return age; }

}

mfmondragona at 2007-7-9 5:39:31 > top of Java-index,Java Essentials,New To Java...
# 3
> i already compiled my UserData.java and stored the UserData.class in webapps/app-root/WEB-INF/classesbut your bean is inside a package called user. Then UserData.class should be in the folder structure WEB-INF/classes/user right? try it I guess so
kalania at 2007-7-9 5:39:31 > top of Java-index,Java Essentials,New To Java...
# 4
i moved my UserData.class to /WEB-INF/classes/user but i still have the same error.
mfmondragona at 2007-7-9 5:39:31 > top of Java-index,Java Essentials,New To Java...