tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <>
Subject Re: adding servlet definition to context on the fly :Tomcat 5.5
Date Sun, 05 Oct 2008 08:55:49 GMT wrote:
> Hi,
> I had written some code to dynamically add a servlet to a context in a
> deployed applicaiton in Tomcat 4.1. This code basically uses the catalina
> loader to obtain the server->engine->host->and context, and invokes the
> addChild method after configuring a StandardWwrapper to represent the
> servlet I am adding. This all works fine in Tomcat4.1 and I am able to
> access the servlet through the right url immediately, without having to
> restart Tomcat.
> However, I tried the same code in Tomcat 5.5 and it does not work. It does
> not throw any errors, but simply does not recognize the url pattern once i
> actually try to invoke the new servlet. I was wondering if anyone had
> tried this before, and if so if they have any suggestions as to why this
> does not work in Tomcat 5.5?

Are you calling addServletMapping() on the context after you have added the
wrapper? It looks like this was unnecessary in 4.1.x but is required in 5.5.x.

If that isn't it, I would suggest attaching you favourite IDE and debugging
your way through the request mapping process to see where it is going
wrong. This certainly should be possible.

As an aside, version 3 of the servlet spec is expected to include this sort
of functionality in the Servlet API.


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message