bigpuritz/netty-servlet-bridge — pull request #5 by nguyenxuanluong-luvina (2014-04-09 11:30:25+00:00)
Title: Update source code for personal purpose

Hi bigpuritz ! The first , thanks for your public source code ,this very useful to my work .
I've been used this source code to implement the Netty + Servlet API in OSGi environment , it work greate for me with a litlte bit of changes .I will be show you what I need and what I changed with netty-servlet-brigde

- What i need :
+ My project building on OSGi environment and I want to work with Netty + Servlet API , I need a servlet handler that have ability to dynamic adding servlet at runtime (after netty server start ,if you add a new servlet or modified ,it will be re-adding to servlet handler for serve request)
+ With the demo in your repository , I see that the servlet should be loaded and initialized before the server ,servlet brigde handler started ,and if i add new servlet at runtime ,the servlet still available to serve request ,but it come without init parameters or init() function to be invoked

- What did i change ?
+ I change a litle of source code to make it work with my require ,detail is following:

- Adding getter/setter for 'servlets' in net.javaforge.netty.servlet.bridge.config.WebappConfiguration
- Update net.javaforge.netty.servlet.bridge.impl.ServletBridgeWebapp constructor visibility to public

When the server started , if new servlet is added at runtime , you need to initialized it ,so I get the servlets and :

1.Check if servlet handler contains a servlet which same as new servlet added then remove it
2.Adding servlet to servlet handler . I'm using :

WebappConfiguration#addHttpServlet(servletInstance,servletPath) )
3.Initialized servlet using ServletBridgeWebapp

ServletBridgeWebapp webServlet = new ServletBridgeWebapp();
webServlet.init(webapp, channel);

Now ,when you adding new servlet or modified the existence , servlet handler will re-adding and initializing it for you

That's all i need to show you about my change , if you have the greater way to accomplished that ,please show me these
Please consider to this pull issue and sorry about my English
Many thanks !