You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by George Hester <he...@hotmail.com> on 2004/03/02 02:45:35 UTC

The purpose of WEB-INF\classes ?

This is not a question to fix a problem other then one in my head.  I am not sure what the difference is putting a jar in a \WEB-INF\lib and setting up a \WEB-INF\classes.  Since a jar usually just includes class files if we put a jar in the webapp's \WEB-INF\lib what would be the purpose of setting the tree of classes expanded in WEB-INF\classes?

Let me give an example.  In Tomcat 4.1.30 there is a server folder.  Under this exists webapps.  And then under this are two folders admin and manager.  Looking at the admin webapp you will find its WEB-INF and under that it has a lib and a classes folder.  The lib folder contains just one jar, ie: struts.jar.  But the classes folder contains the tree of what looks to me is the structure of a jar ie; org | apache | webapp | admin| ...  I am not sure if this is just an expanded struts.jar but it looks to be.  If not struts.jar then likely some other jar.

So my question is what is the purpose of having an extracted jar structure under a classes folder?  I have made my own webapp but I do not have a classes folder under that because I have yet to come across the purpose of when it is necessary?  Thanks. 

-- 
George Hester
__________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: The purpose of WEB-INF\classes ?

Posted by Jon Wingfield <jo...@mkodo.com>.
WEB-INF/classes takes precedence over WEB-INF/lib in the servlet spec: 
2.3fcs, section "SRV.9.5 Directory Structure".
If WebLogic 6.1 behaves differently then it's another spec violation ;)

Jon

Justin Ruthenbeck wrote:
> 
> To you (the end-user), there's no purpose for it other than 
> convenience.  One thing to keep in mind is that classes in the /classes 
> directory take precedence over those in jars found in the /lib directory 
> (in Tomcat -- is this a spec thing? I'm assuming not as WL61 at lease 
> doesn't do this), which is an important distinction that makes the 
> difference more useful.
> 
> As for why it's useful, if you're developing an app and are constantly 
> compiling and testing, why should you have to jar them up each time you 
> compile the classes?  Just stick them in the /classes dir.  On the other 
> hand, releasing and versioning code is much easier as a jar.  Give 
> people flexibility and they'll come up with new and wonderous things...
> 
> justin
> 
> 
> At 05:45 PM 3/1/2004, you wrote:
> 
>> This is not a question to fix a problem other then one in my head.  I 
>> am not sure what the difference is putting a jar in a \WEB-INF\lib and 
>> setting up a \WEB-INF\classes.  Since a jar usually just includes 
>> class files if we put a jar in the webapp's \WEB-INF\lib what would be 
>> the purpose of setting the tree of classes expanded in WEB-INF\classes?
>>
>> Let me give an example.  In Tomcat 4.1.30 there is a server folder.  
>> Under this exists webapps.  And then under this are two folders admin 
>> and manager.  Looking at the admin webapp you will find its WEB-INF 
>> and under that it has a lib and a classes folder.  The lib folder 
>> contains just one jar, ie: struts.jar.  But the classes folder 
>> contains the tree of what looks to me is the structure of a jar ie; 
>> org | apache | webapp | admin| ...  I am not sure if this is just an 
>> expanded struts.jar but it looks to be.  If not struts.jar then likely 
>> some other jar.
>>
>> So my question is what is the purpose of having an extracted jar 
>> structure under a classes folder?  I have made my own webapp but I do 
>> not have a classes folder under that because I have yet to come across 
>> the purpose of when it is necessary?  Thanks.
>>
>> -- 
>> George Hester
>> __________________________________
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
> 
> 
> ______________________________________________
> Justin Ruthenbeck
> Software Engineer, NextEngine Inc.
> justinr - AT - nextengine DOT com
> Confidential. See:
> http://www.nextengine.com/confidentiality.php
> ______________________________________________
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 



Re: The purpose of WEB-INF\classes ?

Posted by Justin Ruthenbeck <ju...@nextengine.com>.
To you (the end-user), there's no purpose for it other than 
convenience.  One thing to keep in mind is that classes in the /classes 
directory take precedence over those in jars found in the /lib directory 
(in Tomcat -- is this a spec thing? I'm assuming not as WL61 at lease 
doesn't do this), which is an important distinction that makes the 
difference more useful.

As for why it's useful, if you're developing an app and are constantly 
compiling and testing, why should you have to jar them up each time you 
compile the classes?  Just stick them in the /classes dir.  On the other 
hand, releasing and versioning code is much easier as a jar.  Give people 
flexibility and they'll come up with new and wonderous things...

justin


At 05:45 PM 3/1/2004, you wrote:
>This is not a question to fix a problem other then one in my head.  I am 
>not sure what the difference is putting a jar in a \WEB-INF\lib and 
>setting up a \WEB-INF\classes.  Since a jar usually just includes class 
>files if we put a jar in the webapp's \WEB-INF\lib what would be the 
>purpose of setting the tree of classes expanded in WEB-INF\classes?
>
>Let me give an example.  In Tomcat 4.1.30 there is a server 
>folder.  Under this exists webapps.  And then under this are two folders 
>admin and manager.  Looking at the admin webapp you will find its 
>WEB-INF and under that it has a lib and a classes folder.  The lib 
>folder contains just one jar, ie: struts.jar.  But the classes folder 
>contains the tree of what looks to me is the structure of a jar ie; org 
>| apache | webapp | admin| ...  I am not sure if this is just an 
>expanded struts.jar but it looks to be.  If not struts.jar then likely 
>some other jar.
>
>So my question is what is the purpose of having an extracted jar 
>structure under a classes folder?  I have made my own webapp but I do 
>not have a classes folder under that because I have yet to come across 
>the purpose of when it is necessary?  Thanks.
>
>--
>George Hester
>__________________________________
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


______________________________________________
Justin Ruthenbeck
Software Engineer, NextEngine Inc.
justinr - AT - nextengine DOT com
Confidential. See:
http://www.nextengine.com/confidentiality.php
______________________________________________


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


RE: The purpose of WEB-INF\classes ?

Posted by mike jackson <mj...@cdi-hq.com>.
The first reason I can think of is configuration files.  I have one
environment on my development box, another on the test deployment box and
yet another on the final production server.  Depending on the box I'm on I'm
going to use different database URLs at a minimum and quite often I'm having
to use different directories for temporary/permanent files depending on
whether I'm on windows or unix.  If I put those configure files into jar
files I'd have to unjar the jars, change the files and then rejar the files
again.  It's much easier to leave those out of the jar files and have them
in the classes folder where you can just go and edit them.

--mikej
-=------
mike jackson
mjackson@cdi-hq.com



> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of George Hester
> Sent: Monday, March 01, 2004 5:46 PM
> To: tomcat-user@jakarta.apache.org
> Subject: The purpose of WEB-INF\classes ?
> 
> This is not a question to fix a problem other then one in my head.  I am
> not sure what the difference is putting a jar in a \WEB-INF\lib and
> setting up a \WEB-INF\classes.  Since a jar usually just includes class
> files if we put a jar in the webapp's \WEB-INF\lib what would be the
> purpose of setting the tree of classes expanded in WEB-INF\classes?
> 
> Let me give an example.  In Tomcat 4.1.30 there is a server folder.  Under
> this exists webapps.  And then under this are two folders admin and
> manager.  Looking at the admin webapp you will find its WEB-INF and under
> that it has a lib and a classes folder.  The lib folder contains just one
> jar, ie: struts.jar.  But the classes folder contains the tree of what
> looks to me is the structure of a jar ie; org | apache | webapp |
> admin| ...  I am not sure if this is just an expanded struts.jar but it
> looks to be.  If not struts.jar then likely some other jar.
> 
> So my question is what is the purpose of having an extracted jar structure
> under a classes folder?  I have made my own webapp but I do not have a
> classes folder under that because I have yet to come across the purpose of
> when it is necessary?  Thanks.
> 
> --
> George Hester
> __________________________________
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org