If you are using Tomcat, you can accomplish this via the Invoker Servlet (org.apache.catalina.servlets.InvokerServlet) in Tomcat's web.xml file. It allows you to execute servlet classes without needing to map them in web.xml.
However, in general this is not a good practice, since servlet mappings function to prevent users from accessing resources that they shouldn't have access to. Also, hundreds of servlets seems excessive! You may want to consider rolling functionality into fewer servlets, and when you do this, mapping becomes much more manageable.
Joined: Jan 30, 2009
Thanks Edwin ,
what if the server is Weblogic ??Is there any option avialable like this ??
Rajat Raina wrote:Front controller is a good option
To be specific you can use struts framework
I think it´s a bit too late to introduce a MVC framework as he already has hundred servlets. You can better start off with a MVC framework from the zero on than applying it on an existing application, otherwise you´re going to waste a lot of time on changing.
A front controller is a better solution. I only hope that his servlets are well designed (thus not tight coupled with business and data logic) otherwise there is still a lot of rewrite needed.