| | |
javaBean
Please support our JSP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 1
Reputation:
Solved Threads: 0
Hi,
I am new to jsp, and Beans. I have been working on this piece of code, for the past week and I am no further along
I am using Tomcat Apache 6.0
In the ROOT folder I have a simple page test1.jsp:
I have a java class in: WEB-INF\classes\user called UserDetails
Which I have attached.
I keep getting the error:
javax.servlet.ServletException: java.lang.NoClassDefFoundError: user/UserDetails (wrong name: java/user/UserDetails)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
As I said I have been working on it, and gotten no where, someone please help!!!
Thanks, Andrew
I am new to jsp, and Beans. I have been working on this piece of code, for the past week and I am no further along

I am using Tomcat Apache 6.0
In the ROOT folder I have a simple page test1.jsp:
JSP Syntax (Toggle Plain Text)
package user; <%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %> <jsp:useBean id="userDetails" class="user.UserDetails" scope="session" /> <jsp:setProperty name = "hopeThisWorks" property="*"/> <% userDetails.getData(); %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>hello</title> </head> <body> test 1 </body> </html>
I have a java class in: WEB-INF\classes\user called UserDetails
Which I have attached.
I keep getting the error:
javax.servlet.ServletException: java.lang.NoClassDefFoundError: user/UserDetails (wrong name: java/user/UserDetails)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
As I said I have been working on it, and gotten no where, someone please help!!!
Thanks, Andrew
Last edited by peter_budo; 27 Days Ago at 8:21 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks)
-1
#2 27 Days Ago
You have package declaration on the top of JSP which is not need it, but you are missing package declaration in your UserDetails where obviously is need it...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Publilius Syrus
(~100 BC)
LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
![]() |
Other Threads in the JSP Forum
- Previous Thread: how can i run jsp
- Next Thread: How to insert data into database?
| Thread Tools | Search this Thread |
apache backbutton combobox connection database development directorystructure dynamicpagetitles eclipse frames glassfish ie8 imagetodatabse imageupload integer internet java javaee javascript jsf jsp jsppagetitles levels mvc2 mvcmodel2 network parameters passing ping printinserverinsteadofclient redirect request.getparameter response servlet servletdopost()readxml sessions software ssl state_saving_method stocks sun tomcat tutorial update video web






