You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@eng.sun.com on 2000/02/23 08:59:38 UTC

Re: Only Having To Put API's in one place???

> This may be a really dumb question but here goes.  How can I configure tomcat in a manner so that I can use my own API's and I only have to place them in a single directory but will still be available to multiple applications.  EX.

This is a very difficult question. 

Right now it is not possible to do it in a portable way. You can add your
APIs to the CLASSPATH before starting tomcat, but this is NOT portable.

The great thing about servlets/jsp ( one of them:-) is that you have
portability, if you decide to move your application to another servlet
engine or from development to production you don't need to do anything
else but deploy. 

My personal opinion is that the price of having your classes in all
applications in not so great and it's worth it:
- you have portable code, no need to think about server config and
classpath

- you can have multiple versions at the same time ( say app1 uses API.v1
and app2 uses API.v2, they can co-exist, no need to upgrade all apps).
That' very important if the apps are complex and developed by different
teams, after app1 is deployed you may need to change something in the API
for app2.

- it's just using a bit more memory - assuming the API is not so big as
size.

Another aproach would be to put everything in one big app, with
sub-directories.

Another - provide feedback to the spec and ask for "context groups" in
servlet.next.

Costin