tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: Splitting up a web app?
Date Fri, 01 Sep 2000 19:09:49 GMT
> We have an existing web directory structure which has web pages in one place
> (shared amongst several web apps), and servlet classes in a couple of other
> locations (again shared).  I wanted to use tomcat with this structure but the
> api 2.2 webapp mechanism seemed too restrictive.

Can't you do that with symlinks ? It should be easy, and no code change is

Note that the 2.2 webapp specification has nothing to do with the internal
tomcat representation - it is just a format for external representation
of web applications ( just like XML is an exchange format - the data can
be stored in a database ).

> So I added a couple of new attributes to the <Context> tag to allow for
> additional class repositories and a web page page different from the
> docBase. A few new methods in 
> 	 src/share/org/apache/tomcat/core/

-1 on adding that in Context ( i.e. in core).

Can you change it a bit ?
- use context attributes ( or notes !). ( you can add code to allow 
server.xml to specify "notes" - that would be very usefull and can go in

- Replace the static and invocation interceptors ( you can extend them 
and override the relevant methods ). The new interceptors can use 
your attributes to implement what you need. You may need to add few 
URLs to the context classpath ( but that can be done in intereptor - no
need  to change the core )

We can create a new "module" containing contributed interceptors and
include your code - same as ant does with all the strange tasks that it
I don't think it belongs in the set of interceptors included in src/share.

> and a change to a couple of methods in the same file was all that was needed.
> Now, is this a bad thing?  Could it ever get into standard Tomcat?
> I can send patches if anyone is interested, but I'd like to gauge how useful
> the mod is.  For us it made it really practical to use tomcat.

I think it can get into tomcat - as long as you re-write your code along
those lines. I'm strongly -1 on adding anything to tomcat.core unless
absolutely required ( and I'm +1 on removing stuff from there !) It took a
lot of work to simplify the core.

Of course, if your use case is not possible using just interceptors then
we'll need to find out what is the minimal change in core that will allow
you to do that. 

Please let me know if you need help, I'm interested in all
"practical" ways to use tomcat :-)


View raw message