Originally posted by Shubhrajit Chatterjee:
I don't think so .... I have often used beans which were not a part of any package and have successfully deployed them in Weblogic 5.1 and WebLogic 6. However the bean class needs to be imported with the jsp directive
<%@ page import="MyBean" %>
This is what I found from
Servlet 2.3 specification. It never mentions that one is not allowed to put a bean outside a package
SRV.9.5 Directory Structure
A web application exists as a structured hierarchy of directories. The root of this
hierarchy serves as the document root for files that are part of the application. For
example, for a web application with the context path /catalog in a web container,
the index.html file at the base of the web application hierarchy can be served to
satisfy a request from /catalog/index.html. The rules for matching URLs to
context path are laid out in Chapter SRV.11. Since the context path of an application
determines the URL namespace of the contents of the web application, web
containers must reject web applications defining a context path could cause
potential conflicts in this URL namespace. This may occur, for example, by
attempting to deploy a second web application with the same context path, or two
web applications where one context path is a substring of the other. Since requests
are matched to resources case sensitively, this determination of potential conflict
must be performed case sensitively as well.
1. See the JavaServer Pages specification available from http://
java.sun.com/products/jsp.ഊDirectory Structure 61
A special directory exists within the application hierarchy named �WEB-INF�.
This directory contains all things related to the application that aren�t in the
document root of the application. The WEB-INF node is not part of the public
document tree of the application. No file contained in the WEB-INF directory may
be served directly to a client by the container. However, the contents of the WEB-
INF directory are visible to servlet code using the getResource and
getResourceAsStream method calls on the ServletContext. Hence, if the
Application Developer needs access, from servlet code, to application specific
configuration information that he does not wish to be exposed to the web client, he
may place it under this directory. Since requests are matched to resource
mappings case-sensitively, client requests for �/WEB-INF/foo�, �/WEb-iNf/foo�,
for example, should not result in contents of the web application located under /
WEB-INF being returned, nor any form of directory listing thereof.
The contents of the WEB-INF directory are:
� The /WEB-INF/web.xml deployment descriptor.
� The /WEB-INF/classes/ directory for servlet and utility classes. The classes
in this directory must be available to the application class loader.
� The /WEB-INF/lib/*.jar area for Java ARchive files. These files contain
servlets, beans, and other utility classes useful to the web application. The web
application class loader must be able to load classes from any of these archive
files.
The web application classloader must load classes from the WEB-INF/ classes
directory first, and then from library JARs in the WEB-INF/lib directory.
SRV.9.5.1 Example of Application Directory Structure
The following is a listing of all the files in a sample web application:
/index.html
/howto.jsp
/feedback.jsp
/images/banner.gif
/images/jumping.gif
/WEB-INF/web.xml
/WEB-INF/lib/jspbean.jar
/WEB-INF/classes/com/mycorp/servlets/MyServlet.class
/WEB-INF/classes/com/mycorp/util/MyUtils.class
[ June 03, 2002: Message edited by: Shubhrajit Chatterjee ]