Extending the Grizzly HTTP Runtime part V: Programatically configuring Servlet and GrizzlyAdapter
Posted by jfarcand on January 8, 2009 at 7:12 PM EST
This blog has moved here
Related Topics >>
Blog Links >>
- Login or register to post comments
- Printer-friendly version
- jfarcand's blog
- 1870 reads






Comments
by jfarcand - 2009-01-26 19:57
@bragest -> I've posted the response here: http://is.gd/hlgc . Ins hort. I agree with you we need to improve the API.by braghest - 2009-01-24 15:18
I see, thank you. However my use case is a bit more complicated ;-) 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.by jfarcand - 2009-01-23 13:51
I've posted the response here -> http://tinyurl.com/btmo2x so the community can comments/help. Thanks!!by braghest - 2009-01-23 13:42
When adding filters is it also possible to set a filter mapping and the dispatcher types? I need this and it can be done with Jetty.by jfarcand - 2009-01-12 11:01
See the answer here: http://tinyurl.com/9p6kmm and the following discussion.by greeneyed - 2009-01-09 11:56
Is it possible to have an embedded version but that reads the configuration from files like a regular container would do?I say so because I currently use Jetty embedded and I use always the same "Jetty launcher" code and I just point it to the proper directory to be mounted and it reads the web.xml and deploys the application, etc.
This was I can re-use the same code for every tiny application I want to, without harcoding the servlets, filters etc. that I need. And at the same time, the web application can be mounted in a regular container without a change.
I understand how doing everything in code can be very useful sometimes, but in my case I'd rather do it like that..
Salute and good job!