Tomcat like your bean in a package. 

-----Original Message-----
From: Roy Smith [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 20, 2004 4:31 PM
To: [EMAIL PROTECTED]@jakarta.apache.org
Cc: Roy Smith
Subject: Why can't tomcat find my bean classes? 

I'm running jakarta-tomcat-5.0.18 on OSX.

I've got a trivial little JSP file:

<jsp:useBean id="doubler" class="DoublerBean" scope="page">
    <jsp:setProperty name="doubler" property="in" value="wugga"/>
</jsp:useBean>
<html>
<body>
It looks like &quot;<jsp:getProperty name="doubler"
property="out"/>&quot;
</body>
</html>

and my DoublerBean.java file is pretty simple too:

public class DoublerBean
{
      private String phrase;

      public DoublerBean ()
      {
          // empty
      }

      public void setIn (String phrase)
      {
          this.phrase = phrase;
      }

      public String getOut ()
      {
          return (phrase + ", " + phrase);
      }
}

When I run ant, I get a build/WEB-INF/classes/DoublerBean.class file,
but my jsp application can't seem to find the DoublerBean class.  When
I reload my app through the manager and run it, I get:

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 1 in the jsp file: /foo.jsp

Generated servlet error:
      [javac] Compiling 1 source file

/usr/local/jakarta-tomcat-5.0.18/work/Catalina/localhost/SquawkLog/org/
apache/jsp/foo_jsp.java:40: cannot resolve symbol
symbol  : class DoublerBean
location: class org.apache.jsp.foo_jsp
        DoublerBean doubler = null;
        ^

and a few more similar errors complaining that it can't resolve
DoublerBean.  Other JSP pages I wrote were able to find their required
classes in the same location.  What's different about finding bean
classes?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.557 / Virus Database: 349 - Release Date: 12/30/2003
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to