You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ra...@agileitinc.com on 2008/05/19 17:27:12 UTC

In memory copy of web.xml

Hi,

I am writing an application where we need to edit the client's web.xml
file to provide a context path to  a servlet inside our jars.
Right now, I am only able to eidt the web.xml file when Tomcat is
shutdown, as
the file is locked when Tomcat is running. I assume Tomcat makes an internal
representation of this file in memory. Does anyone know which class is
responsible for this? More generally, I am looking for a way of
dynamically adding a servlet to a web application without having to
restart the server.
Is this possible?

Thanks

Ram


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: In memory copy of web.xml

Posted by Johnny Kewl <jo...@kewlstuff.co.za>.
----- Original Message ----- 
From: <ra...@agileitinc.com>
To: <us...@tomcat.apache.org>
Sent: Monday, May 19, 2008 5:27 PM
Subject: In memory copy of web.xml


> Hi,
>
> I am writing an application where we need to edit the client's web.xml
> file to provide a context path to  a servlet inside our jars.
> Right now, I am only able to eidt the web.xml file when Tomcat is
> shutdown, as
> the file is locked when Tomcat is running.

That actually doenst sound right... I've done that before, edit the web.xml 
and you can.
You have to hit it one time though... because once you change it.... TC will 
start to go thru a
restart... ie it knows you messed with it and starts trying to fix itself.
So in theory if you have also manage to drop a new servlet in, and to get 
that right, you probably have to pack the whole things as classes and not
jars... yes, after much pain... it will work... but it will still restart... 
so you are snookered.

And it wont restart, if something is in the web app and holding it... but 
when it goes... then it will restart... and while thats happening, bad luck 
if a customer hits it.
Your scheme is flawed... but its a cool idea ;)

====

Think about this rather....
You can make a servlet... and you can map it with a wild card

ie /webapp/futurestuff/*

Now ANYTHING, like
/webapp/futurestuff/aServletThatWeForgotAbout

is mapped to that servlet...

Then inside that FutureStuff servlet you check the URL...

If its aServletThatWeForgotAbout_1

then you load that class and run it...

The classes have to live in one of the libs or the webapp... and

if you look up

Class.forname("ComeLately");

you in business ;)

---------------------------------------------------------------------------
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
--------------------------------------------------------------------------- 


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org