"Rachel McConnell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'd like to keep it there, as most of the apps use the same configuration > and it's repetetive to have identical configs in most of the webapps. > I'll test that, though; it should at least determine whether the > DefaultServlet is a singleton or not! > > Anyone else have information on this? >
Well, what comes to mind is in your web.xml: <servlet> <servlet-name>myapp-default</servlet-name> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> <init-param> <!-- My specialized init params here --> </init-params> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>myapp-default</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> This has the downside of loading DefaultServlet twice for each app, but that shouldn't be too bad in most cases. > thx, > Rachel > > Farrow, Marc wrote: >> The first question I have is do you want/need to keep the default servlet >> definition in your CATALINA_BASE/conf/web.xml file? If not, then just >> remove >> it from there and just push the "default" configuration to every web.xml >> for >> each application. If you have a need for the default configuration in >> the >> CATALINA_BASE/conf/web.xml, then I am not the one to help. Sorry. >> >> >> -----Original Message----- >> From: Rachel McConnell [mailto:[EMAIL PROTECTED] >> Sent: Saturday, March 25, 2006 5:31 PM >> To: Tomcat Users List >> Subject: configuring the default servlet >> >> >> I have several web applications running in the same instance of Tomcat >> 5.5 and I'd like to configure the default servlet differently for some >> of them. The default configuration is in the web.xml file in the >> CATALINA_BASE/conf directory, and each webapp has its own web.xml file >> in its WEB-INF/ directory. >> >> I tried to override the default servlet configuration in one of the >> webapps by simply copying the configuration from the main web.xml file >> and changing the configuration to what I wanted, but the app would not >> start up. I got a parse error: >> >> SEVERE: Parse error in application web.xml >> java.lang.IllegalArgumentException: addChild: Child name 'default' is >> not unique >> >> Which of course is an accurate message - I'm trying to override >> 'default' for a particular webapp. >> >> Is this the correct way to approach the problem? I could not find a >> discussion of this in the Tomcat docs. Is it even possible to have >> different default servlet configurations on a webapp by webapp basis or >> is there only one default servlet object for each Tomcat instance? >> >> Thanks, >> Rachel >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]