This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JSP and the fly likes The value for the useBean class attribute user.UserData is invalid. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "The value for the useBean class attribute user.UserData is invalid." Watch "The value for the useBean class attribute user.UserData is invalid." New topic
Author

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

naveen gandham
Greenhorn

Joined: Oct 15, 2008
Posts: 8
I am trying to get the data by using bean where I am facing the problem while running it ...

<html>
<body>
<form method=post action = "UserSave.jsp">
Name<input type =text name=username size =20><br>
Email<input type=text name=email size=20><br>
Age <input type=text name=age size=4><br>
<input type=submit>
</form>
</body>
</html>
---------------------------
UserData---java

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; }
}
-------------------
<jsp:useBean id="user" class ="user.UserData" scope="session"/>
<jsp:setProperty name="user" property="*"/>
<html>
<body>
<a href="NewPage.jsp">continue </a>
</body>
</html>-------------UserSave.jsp
---------------------
<jsp:useBean id="user" class="user.UserData" scope="session"/>
<html>
<body>
You Entered <br>
Name:<%= user.getUsername() %><br>
E-mail:<%= user.getEmail() %><br>
Age : <%= user.getAge() %><br>
</body>
</html>------------NewPage.jsp
-------------------------------------------



org.apache.jasper.JasperException: /jsp/UserSave.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:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


else this the url from where i am trying as an example
http://www.jsptut.com/Forms.jsp
Steve Luke
Bartender

Joined: Jan 28, 2003
Posts: 3087
    
    5

Your user.UserData.class file is in:
<Application_Base>/<application_name>/WEB-INF/classes/user/
directory? It is spelled properly?


Steve
naveen gandham
Greenhorn

Joined: Oct 15, 2008
Posts: 8
Hmm I have forgot to place the compile .class file under classes directory .now it working fine..........
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: The value for the useBean class attribute user.UserData is invalid.
 
Similar Threads
Bean In JSP problem
The value for the useBean class attribute user.userData is invalid.
java bean , jsp page and parameters
Where to put bean class in Tomcat?
use of value object ( javabeans )