You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@openwebbeans.apache.org by Aaron Anderson <aa...@acm.org> on 2018/02/01 05:40:51 UTC

Adding Servlets and ServletContainerInitializer programatically to a web application deployed to Meecrowave

Hi All,
I was wondering if there was a way to programatically add a Servlet or ServletContainerInitializer to a web application before it is deployed in Meecrowave? I know there is an InstanceCustomizer but this works at the Tomcat level and not at the application context level before the application is initialized. I could of course add the listeners into the application itself but I am working on a Meecrowave extension to do some preparatory work before the deployment occurs.
Thanks,
Aaron 

Re: Adding Servlets and ServletContainerInitializer programatically to a web application deployed to Meecrowave

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi Aaron

Yes you can:
1. For an extension a listener is not bad
2. Plain registration (meta-inf/services) should work too - or google
autoservice if you dont like it ;). Im mentionning it cause there is no
real reason to not do it this way AFAIK
3. If deploy is called with a context consumer you can here too


Le 1 févr. 2018 06:41, "Aaron Anderson" <aa...@acm.org> a écrit :

Hi All,

I was wondering if there was a way to programatically add a Servlet
or ServletContainerInitializer to a web application before it is deployed
in Meecrowave? I know there is an InstanceCustomizer but this works at the
Tomcat level and not at the application context level before the
application is initialized. I could of course add the listeners into the
application itself but I am working on a Meecrowave extension to do some
preparatory work before the deployment occurs.

Thanks,

Aaron