doctor john to followup with the addChild method and if an exception is thrown and you determine your container doesnt support child containers..what then?
your diagnosis doctor.. Martin ______________________________________________ Disclaimer and confidentiality note Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. > From: [EMAIL PROTECTED] > To: users@tomcat.apache.org > Subject: Re: adding servlet definition to context on the fly :Tomcat 5.5 > Date: Sat, 4 Oct 2008 21:20:39 +0200 > > > ----- Original Message ----- > From: <[EMAIL PROTECTED]> > To: <users@tomcat.apache.org> > Sent: Saturday, October 04, 2008 5:34 PM > Subject: adding servlet definition to context on the fly :Tomcat 5.5 > > > > 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. > > I'd luv to see that code... the stuff you playing with is in Tomcat core... > must have been difficult to debug... perhaps its an embedded app? > > But I think this answers your question... > > public void addChild(Container child) { > > throw new IllegalStateException > (sm.getString("standardWrapper.notChild")); > > } > > is what addChild now looks like in 6... if they did allow it, now they > dont (; > > Dont think you can blame TC... whoever made that app was doing open heart > surgery ;) > > I've never tried this, but its really interesting... I think I would start > by having a good look at... > > HttpServlet source code... its an abstract class with a little > introspection... > > but I (think... maybe) that the way to go is to make a servlet... that does > what HttpServlet servlet does... and then load your sevlet classes into your > servlet... and call them... > > I (think... maybe) maybe that it will come down to doing your own servlet > mapping... and detection of new classes added... possibly your own uri to a > "manager" function... > > ie I think you can make a servlet intelligent enough to do this... without > climbing into the engine and doing a liver transplant... and then because > you now inside the official API... this will never happen again. > > In the end it will be something like > http://domain/contect/addons/ANY_ADD_ON_SERVLETS > > ... I'd give that a bash... dont think its a good idea trying the current > method even if you do find an open vein ;) > > Good Luck... > > --------------------------------------------------------------------------- > HARBOR : http://www.kewlstuff.co.za/index.htm > The most powerful application server on earth. > The only real POJO Application Server. > See it in Action : http://www.kewlstuff.co.za/cd_tut_swf/whatisejb1.htm > --------------------------------------------------------------------------- > > > --------------------------------------------------------------------- > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > _________________________________________________________________ Get more out of the Web. Learn 10 hidden secrets of Windows Live. http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!5295.entry?ocid=TXT_TAGLM_WL_domore_092008