I would like you to site a source, since I have code that proves the
contrary.  The key is that if the classes are not in a package, then you
must explicitly import them.  They are still usable, and can be found, but
you must explicitly import them instead of using a wildcard to import them.

        The reason for this (so that some of you might be able to reason
about your problems in the future so that you don't have to keep asking
here) is that your JSP is converted to a .java file.  The package of that
.java file is generated based upon its path inside of your web application.
Why you might ask?  So that you can have multiple JSPs with the same file
name in different directories.  So, this generated file has a package that
is not the default (blank) package.  In Java classes can only see the
classes in their own package and those that are imported.  Therefore, unless
you import the package-less classes you can't use them.  And Java doesn't
allow import * to mean import all package-less classes, which is why a
wildcard won't work.

        I have no idea if this solves the original problem, but I needed to
contradict a mistaken or misleading answer.

        Randy

> -----Original Message-----
> From: Jann VanOver [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 4:37 PM
> To: '[EMAIL PROTECTED]'
> Subject: RE: JSP's not finding classes in WEB-INF 
> 
> 
> No, this is not right.  Bean classes ARE SUPPOSED TO go into
> WEB-INF\classes.  As I mention in another post, there is a 
> bug in Tomcat
> that keeps them from being found unless they are in a 
> package.  Put classes
> into packages and put the packages in WEB-INF\classes and 
> everything works
> fine!
> 
> -----Original Message-----
> From: Aditya Anand [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, July 18, 2001 11:09 AM
> To: [EMAIL PROTECTED]
> Subject: Re: JSP's not finding classes in WEB-INF 
> 
> 
> > Greetings!
> > 
> > Ok - running Tomcat 3.2 on SunOS 2.7, with Java 1.2.
> >  
> > 
> > I have a working application with servlets and JSP
> > pages running under
> > Tomcat 3.1.  I'm trying to port it to 3.2.
> > 
> > However, every time I hit a JSP page, it gives a 500
> > error about how it
> > cannot find classes to compile.  Those classes are
> > located in the WEB-INF
> > directory, under the /classes folder.  
> 
> I assume these are your bean classes. These should be
> put under the WEB-INF/lib directory rather than the
> classes directory. The classes directory is ment only
> for un-jarred servlet classes that have been declared
> in the web.xml file.
> 
> > The classpath does *not* contain the WEB-INF/classes
> > directory.
> you donot have to specify WEB-INF/classes in the
> system classpath
>  
> > If I hard-code the WEB-INF/classes directory into
> > the classpath, they
> > work.  However, I do not want to do this.  
> > 
> > What is the problem, and how can I resolve it?
> > 
> > I have tried settiing the environment variables
> > TOMCAT_HOME and JAVA_HOME,
> > and moving tools.jar into TOMCAT_HOME/lib.
> Put any servlet jars, beans, and required
> non-statndard libraries under the lib folder (like
> log4J, or xalan)
> 
> cheers
> Adi
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
> 

Reply via email to