Jan Luehe wrote:
Hans,

good point. What about environments that embed Tomcat without following
Tomcat's directory layout, and in which the classloader hierachy/depth is different from that in Tomcat?



I don't give them that option (with regards to this) in LiteWebServer. The only place I look for shared libraries is $CATALINA_HOME/shared/lib. Is that really a severe limitation, you think?

I think it depends on whether you anticipate (or support) LiteWebServer being bundled (as one or more libraries) into other products that use a different directory layout, with different locations for shared libs. If that's the case, limiting the location of shared libs to $CATALINA_HOME/shared/lib might be too restrictive.

Your milage may wary, but no one embedding LiteWebServer (LWS) today has complained.

I think sometimes too much flexibility is what makes a product hard to
use. With LWS, I've stripped down Tomcat to the bare minimum and removed
a lot of choices, and people seem to like how simple things get this
way.

That's why Tomcat searches the webapp's classloader delegation chain for JARs, which ensures that it will find shared libs regardless of their location. Of course, by searching the classloader chain all the way up, we end up parsing too many JARs. I think it's impossible to know ahead of time where to stop in the chain, until you've actually traversed the entire chain. For example, an approach that walks the chain just two levels up won't work in environments where the classloaders 3 or 4 levels up in the chain are also responsible for loading shared libs.

Sure, if you can't restrict installation of shared tag libraries to a directory with a well-known name (off some configurable base, like CATALINA_HOME), you have no choice but to walk the chain. It's up to you to decide if it's worth it or not. I'm just piping in with an alternative that works fine for me and my users.

Hans
--
Hans Bergsten                                <[EMAIL PROTECTED]>
Gefion Software                       <http://www.gefionsoftware.com/>
Author of O'Reilly's "JavaServer Pages", covering JSP 1.2 and JSTL 1.0
Details at                                    <http://TheJSPBook.com/>


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



Reply via email to