"Schreyer, Marcus" wrote:
>
> Hi folks,
> I am trying to access a Java Bean (located under the Web-inf/classes
> directory) from a JSP that is under a subdirectory of the context.
> Everything works fine, when this is done directly on the context level. But
> within a subdirectory the compiler is not able to compile the generated
> servlet anymore. Basically he is not able to find the class and assumes that
> it belongs to the package name that corresponds with the subdirectory name.
> Do I have to configure such things in the web.xml deployment descriptor or
> is this simply a bug of Tomcat?

I answered a very similar question on this list Monday. In other words,
the fastest way to find an answer to questions is often to search the
archive for this list:

  <http://archives.java.sun.com/archives/jsp-interest.html>

The problem you see has to do with how Java deals with classes in the
"unnamed package". You can either make your bean part of a package or
use a page directive to import the bean. For more details, see an article
I wrote for O'Reilly that describes this and other common issues:

  <http://java.oreilly.com/news/jsptips_1100.html>

Hans
--
Hans Bergsten           [EMAIL PROTECTED]
Gefion Software         http://www.gefionsoftware.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to