java bean file not found / cannot resolve symbol r
:) hi everybody,
--------------------------------------------------------------------------
Brief intro.
I am a fresh new comer to devX forum, and yesterday I installed tomcat and wanted to try the power of java bean by implementing the code under JSP web developement platform. MY code is attached within the .zip file. This is just a simple program to get user's data username, password, and gender into the bean file, then when user click next the data value stored will be displayed on that particular page.
--------------------------------------------------------------------------
My key point of error:
<jsp:useBean id="user" class="registerUser" scope="session"/>
The error message are:
org.apache.jasper.JasperException: Unable to compile class for JSP
--------------------------------------------------------------------------
An error occurred at line: 1 in the jsp file: /login/action.jsp
Generated servlet error:
[javac] Compiling 1 source file
C:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\_\login\action_jsp.j ava:42: cannot resolve symbol
symbol : class registerUser
location: class org.apache.jsp.action_jsp
registerUser user = null;
--------------------------------------------------------------------------
My platform for running JSP are :
Tomcat - C:\Program Files\Apache Group\Tomcat 4.1
java - C:\j2sdk1.4.2_10
My system classpath are:
C:\Program Files\Java\j2re1.4.2_10\lib\ext\QTJava.zip;C:\Prog ram Files\mysql\mysql-connector-java.jar;C:\j2sdk1.4.2_10\jre\lib\ext\mysql-connector-java-3.0.17-ga-bin.jar;C:\Program Files\Apache Group\Tomcat 4.1\webapps\ROOT\WEB-INF\classes;c:\java;
my java file compilation folder was located at C:\java
--------------------------------------------------------------------------
What happened to this code?? Can any kind helper assist to explain the root cause of this error, and if possible guide me throught this error??
-------------------------------registeruser.jsp-----------------------
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<html>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<head>
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
font-family: Geneva, Arial, Helvetica, sans-serif;
font-weight: bold;
color: #FFFFFF;
}
.style3 {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
}
-->
</style>
</head>
<body>
<form name="form1" method="post" action="action.jsp">
<input type="hidden" name="authenticate" value="run">
<table width="605" border="0" align="center" bgcolor="#666666">
<tr>
<td colspan="2"><div align="center">
<h3 class="style1">Register new user </h3>
</div></td>
</tr>
<tr>
<td class="style1">user ID:</td>
<td><div align="left">
<input name="username" type="text" id="username">
</div></td>
</tr>
<tr>
<td class="style1">password:</td>
<td><div align="left">
<input name="password" type="text" id="password">
</div></td>
</tr>
<tr>
<td class="style1"> gender </td>
<td><input name="gender" type="radio" value="male">
<strong class="style3">male</strong> <input name="gender" type="radio" value="female">
<span class="style3">female </span></td>
</tr>
<tr>
<td colspan="2" class="style1"></td>
</tr>
<tr>
<td> </td>
<td><div align="left">
<input type="submit" name="Submit" value="Submit">
</div></td>
</tr>
</table>
</form>
</body>
</html>
-------------------------------registeruser.jsp----------------------
public class registerUser
{
String username="";
String password="";
String gender="";
public void setUsername(String username)
{
this.username=username;
}
public void setPassword(String password)
{
this.password=password;
}
public void setGender(String gender)
{
this.gender=gender;
}
public String getUsername()
{
return username;
}
public String getPassword()
{
return password;
}
public String getGender() {
return gender;
}
}
-------------------------------action.jsp----------------------------
<jsp:useBean id="user" class="registerUser" scope="session"/>
<jsp:setProperty name="user" property="*"/>
<HTML>
<BODY>
<A HREF="NextPage.jsp">Continue</A>
</BODY>
</HTML>
-----------------------------nextpage.jsp----------------------------
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<jsp:useBean id="user" class="registerUser" scope="session"/>
<jsp:setProperty name="user" property="*"/>
<HTML>
<BODY>
Username: <%= user.getUsername() %><br>
Password: <%= user.getPassword() %><br>
Gender: <%= user.getGender() %><br>
</BODY>
</HTML>
:)
|