I have a Java web application that uses a plugin architecture. I would like to know if anyone has a solution where by one could add a servlet, with serlvet mapping to the se
Adding and removing classes to/from a running application is hard. You may want to look at JRebel for a commercial solution.
If your users don't have very long running conversations/sessions, possibly a restart of your Web app can be quick enough that they won't notice. If this will do it for you, then the problem becomes pretty easy.
Assuming you're running Tomcat, you can configure your server with reloadable=true and it will restart your app whenever you throw a new web.xml into the webapps directory. You can add new classes to the WEB-INF/classes directory and then update web.xml, that should work fine. Removing classes may be harder if those classes are in use. You may want to do a 2 step process where you first deploy a web.xml that no longer routes to a given servlet class, then wait a bit for class users to go away, and then delete the class and redeploy an updated web.xml again.