On 27/02/2014 17:12, Johan Compagner wrote:
> thx,
> 
> On 27 February 2014 15:25, Mark Thomas <ma...@apache.org> wrote:
> 
>>
>> You haven't started the Context so the attributes won't have been
>> populated.
>>
>> Try adding a ContextListener to the context and use that to set up the
>> endpoints using the programmatic API.
>>
>> Mark
> 
> 
> I have it working for WebSocket endpoints yes. Those can be added at
> anytime it seems on the fly
> 
> Problem is that i want to do the same for servlets and filters (then onces
> that are annotated).. But the context is already initialized
> so even call ServletContext.addFilter(Filter.class)
> directly after Catalina.load(); (but before start()) will already result in:
> 
> SEVERE: A child container failed during start
> java.util.concurrent.ExecutionException: java.lang.IllegalStateException:
> Filters can not be added to context /beans as the context has been
> initialised
>  at java.util.concurrent.FutureTask.report(Unknown Source)
> 
> 
> or is it possible to do something directly on the StandardContext ?

You can do it directly (look at the unit tests for lots of examples). Or
you can do it via a ServletContextListener.

Mark



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

Reply via email to