users@grizzly.java.net

(Adding Filter Mapping) Re: [Jean-Francois Arcand's Blog] New Comment Posted to 'Extending the Grizzly HTTP Runtime part V: Programatically configuring Servlet and GrizzlyAdapter'

From: Jeanfrancois Arcand <Jeanfrancois.Arcand_at_Sun.COM>
Date: Mon, 26 Jan 2009 20:53:44 -0500

foo_at_bar.com wrote:
> Name: braghest

> I see, thank you. However my use case is a bit more complicated ;-)

I see..


I have two filters with different mappings and a context listener. It is
important that the listener has servlet API semantics (singleton,
methods invoked just once, ...).
>
> Currently my code in Jetty looks with this:
>
> Context context = new Context(null, "/", options);
> context.addEventListener(new EventListener());
> context.addFilter(AFilter.class, "/a*", Handler.REQUEST);
> context.addFilter(BFilter.class, "/b*", Handler.REQUEST);
>
> which is very simple. I fear that when I add two ServletAdapters to a GrizzlyWebServer or a GrizzlyAdapterChain that the context listener will receive events twice.

Hum. I don't think you will, but I agree the API could be improved. Do
you mind filing an issue here:

https://grizzly.dev.java.net/issues/

I will take a look as son as possible.

Thanks

-- Jeanfrancois


>