On 21/09/18 05:57, Igal Sapir wrote:
> I want to embed Tomcat in a simple application that does not use JSP, and
> that sets the default servlet's listings initParam to true.
> 
> When I use the StandardContext, Tomcat.initWebappDefaults() [1] is called
> and adds the default servlet and the JSP servlet.  I would like to prevent
> that, but hopefully without having to rewrite the whole Tomcat class nor to
> subclass it.
> 
> Further, when I try to override a setting in WEB-INF/web.xml, e.g. to
> specify init-param of "listings" with value "true" for the servlet
> "default", I get an error that "default" is not unique, but in a regular
> Tomcat deployment that works just fine.
> 
> Is there an easy way to override Tomcat.initWebappDefaults() or to prevent
> it from being called?

There are a couple few options.

Sub-classing looks to be the simplest.

You can use addContext() rather than addWebapp() but then you become
responsible for all of the configuration. If the app is simple, this
shouldn't be too much effort.

Mark

> 
> Thanks,
> 
> Igal
> 
> [1]
> https://github.com/apache/tomcat/blob/trunk/java/org/apache/catalina/startup/Tomcat.java#L918
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to