You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ipsi <nz...@gmail.com> on 2008/07/23 01:23:02 UTC

Struts and EAR Files - questions about how it deals with the classloader

Forgive my ignorance, but I'm trying to understand J2EE, and my understanding
of an EAR file is as follows:

Top level contains libraries, a WAR, and JARs for your EJBs, correct? And
there's a separate classloader for the EAR, the WAR, and for each JAR, with
the JAR and WAR classloaders being children of of the EAR classloader,
right? I understand this means that the WAR can see stuff in the EAR (like
the libraries), but it can't see stuff in the JARs (different classloaders),
and the libraries can't see anything (or only classes?) in the WAR, again
because they use different class loaders?

Assuming the above is correct, how is it that that Struts, if placed with
the rest of the libraries in the top level of the EAR, is able to see the
JSP files and whatnot inside the WAR? I know that other classes in the
libraries can't (ClassDefNotFound errors), so yeah. Not sure I understand
what's happening there. I'm using Geronimo 2.1.1 if it makes a difference. I
think I'm using Struts 1.2.4, and Java 5.

e.g.

EAR
 |-----/libs/struts.jar
 |-----WAR
           |-----/index.jsp
 |-----EJB.jar

How does struts know where to look for index.jsp?
-- 
View this message in context: http://www.nabble.com/Struts-and-EAR-Files---questions-about-how-it-deals-with-the-classloader-tp18600894p18600894.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Struts and EAR Files - questions about how it deals with the classloader

Posted by Piero Sartini <li...@pierosartini.de>.
>  |-----/libs/struts.jar
>  |-----WAR
>  |
>            |-----/index.jsp
>  |
>  |-----EJB.jar

/libs/ is for general libraries used by your application (logging comes to 
mind, StringUtils or just about anything that is used among your modules).

The struts.jar has to go into the WAR. Under /WEB-INF/lib/.
You do not change anything within your WAR just because you package it into an 
Enterprise Archive (EAR).

	Piero

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