Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java Open Source > Apache Tomcat
|
Apache Tomcat General discussion of the Apache Tomcat servlet container. For discussions specific to the Professional Apache Tomcat book, please see the book discussion forum for that book.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Apache Tomcat section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 16th, 2006, 06:59 AM
Authorized User
 
Join Date: Aug 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Calverstine Send a message via MSN to Calverstine
Default cannot resolve object, cannot find java file!!help

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>&nbsp;</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>

 
Old May 18th, 2006, 11:43 AM
Authorized User
 
Join Date: Apr 2005
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Couple of clarifications.

Did you mean registerUser.java? or registerUser.jsp?

In case you are referring to registerUser.java, did you compile the class and put it in WEB-INF/classes directory of the application?

Regards,
eNJay

 
Old May 20th, 2006, 09:40 AM
Authorized User
 
Join Date: Aug 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Calverstine Send a message via MSN to Calverstine
Default

In that case, actually i already tried compiling from .java to become .class file, my only problem is i do not know where i can place .class file, my .jsp file resides in: C:\Program~\Apache~\Tomcat 4.1\webapps\ROOT\login. Where should i place my .java file? Please kindly help, TQ for those with a warm reply

 
Old May 22nd, 2006, 03:02 PM
Authorized User
 
Join Date: Apr 2005
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Since your jsp is in C:\Program~\Apache~\Tomcat 4.1\webapps\ROOT\login, put your classes under C:\Program~\Apache~\Tomcat 4.1\webapps\ROOT\WEB-INF\classes





Similar Threads
Thread Thread Starter Forum Replies Last Post
i have the problem on java mail somebody resolve senthilrm J2EE 0 June 29th, 2007 06:46 AM
java bean file not found / cannot resolve symbol r Calverstine JSP Basics 4 July 3rd, 2006 05:38 AM
How to Find databaseName of particular object? ramk_1978 SQL Server 2000 3 May 29th, 2006 09:08 AM
can't find an object kliu9 Excel VBA 7 March 4th, 2005 06:21 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.