Chen, Gin wrote:
> This is kind of a funny issue. If you do not have a package for a
> particular class, you have to add the class file to the lib directory of
> WEB-INF (create one if you dont have one). If it does have a package,
> then it is safe to put into the classes directory. You do not have to
> jar it up first.
No, that's not correct. The rule is that JAR files go in the
WEB-INF/lib directory, class files that are not in a JAR file
go in the WEB-INF/classes directory. This a rule defined by the
Servlet specification.
The fact that class files must be stored in a directory structure
that mirrors the package name structure is a general Java class
loader rule. It applies both to how class files are organized
within a JAR file and to how they are organized in a file system.
So, class in the default package always go in the top directory,
in the JAR file or in the file system. A class in package a.b.c goes
in the directory a/b/c, in the JAR file or in the file system.
The answer to the original question ("why does my bean has to be
in a package to be found") can be found here:
<http://thejspbook.com/faq/details.jsp?id=1007>
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
Author of JavaServer Pages (O'Reilly), http://TheJSPBook.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://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com