On May 21, 2005, at 7:31 AM, Felipe Leme wrote:

On Sat, 2005-05-21 at 15:16 +1000, Brett Porter wrote:

This is a bit out of context. What I haven't seen a reason for is why
WEB-INF/classes should be packaged as a JAR in lib instead, and what
that benefits you.

Ok, I see your point - I guess it's more of a personal preference.
Anyway, the same argument could apply against the current way: why
should the classes be on WEB-INF/classes instead of a jar?

Servlet spec 2.4 says this (section 9.5):
• 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 ARchivefiles. 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. ...

-------------
I conclude from this that the WEB-INF/classes area is the primary area you are expected to put your classes in, and WEB-INF/lib is a secondary area for other stuff you scrounged up from somewhere else. In particular they are not equivalent, since the WEB-INF/classes area is first on the classloader path. Putting everything in WEB-INF/lib removes the possibility of overriding classes with this mechanism.

From this I think the most reasonable behavior for maven is to only put java classes from the current project in WEB-INF/classes and to require putting the java in a separate project if you want them in a jar in WEB-INF/lib.

thanks
david jencks

<giant snip>

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

Reply via email to