javax.servlet.ServletException
[nobr]Can someone help me out. I am new to JSPs
I trying to learn how to use javaBeans and JSPs and get the following errors (they alternate when I refresh the page)
javax.servlet.ServletException: sample/UserData (wrong name: UserData)
root cause
java.lang.NoClassDefFoundError: sample/UserData (wrong name: UserData)
or
org.apache.jasper.JasperException: Unable to loadclassfor JSP
root cause
java.lang.ClassNotFoundException: org.apache.jsp.my_005ffiles.first_005fbean_jsp
I have a class UserData
package sample;
publicclass UserData{
String txtUsername;
String txtPassword;
public UserData(){}
....
JSP Page
<body bgcolor="#ffffff">
<h1>Here is the bean data</h1>
<%-- Create and initialize bean --%>
<jsp:useBean id="user" class="sample.UserData">
<jsp:setProperty name="user" property="txtUsername" value="myname" />
</jsp:useBean>
User name: <c:out value="${user.txtUsername}" /><br/>
</body>
I altered the server.xml file
<Host name="localhost" appBase="C:\.....folder\appdir"
unpackWARs="true" autoDeploy="true"
deployOnStartup="true"
xmlValidation="false" xmlNamespaceAware="false">
<Context
path=""
docBase="C:\...folder\web"
crossContext="false"
debug="0"
reloadable="true">
</Context>
.......default rest of way
I store my UserData.class file in WEB-INF\classes\sample\
which is located in another sample webapp I got from the O'reilly site:
ora\
so my directory structure looks like
C:\......folder\ora\WEB-INF\classes\sample
UserData.class
C:\.....folder\ora\my_files
first_bean.jsp
Does anyone know what is going on?
If you need more info, I will provide.
Thanks[/nobr]

