I got zero Google hits on "component dispatcher servlet", but plenty on "dispatcher servlet". Where did you find the term?
Any number of frameworks send all HTML requests to a single servlet, use the URL or hidden fields to decide what object should get control next, and dispatch to that object. Does that fit what you expected?
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Joined: Mar 29, 2005
you hit the bulls eye, Thanks a lot.
And I want to know why all the frameworks need to direct all html requests thru this dispatcher servlet, is it necessary or any other alternatives to it?
I came across this term in Documentum 'application development framwork'.
It is the best practice to use MVC design pattern. Model-View-Controller. If you send all the forum requests to a single servlet,then that servlet becomes the controller for the flow. So in this way,if you want to make modification to the view,it doesn't affect the controller and the model. Hope this answers your question. Vani.
Originally posted by Vani Nandeesh: If you have multiple controllers, then do you have another servlet to control the flow to theses servlets. How does it work?
I can think of it two ways. You can have a front controller, which is mapped to all the URL's, to forward requests to second level controllers based on some parameter values or request uri, then those controllers take care of their specific job and forward to appropriate view components. The other way is that you can map separate urls to separate servlets so that each servlet can process its designated url request. This is probably what Ben mentioned. Struts action mapping technique seems like using the former way.
Sometimes mix of front controller and MVC pattern can be useful.
In this case I support lee to have Front Controller where all the requests come into application thru one way. Then we can have Component Level Dispatchers wherein these are again Servlets but invoked based on the Parameters. May be you can name this as "Component Dispatcher Servlet".
Joined: Mar 31, 2005
Thanks Lee and Srinivas. My question is answered.
Joined: Jan 29, 2003
Running all requests through a single servlet gives you a neat place to put common security, performance monitoring and a bunch of other useful control stuff. Some designs have a servlet per page and even though they still act as controllers that makes it a little less easy to manage some of those common things across all pages.
Some people prefer to do to this common stuff in filters, a rather newer concept in servlet engines. I gotta look into that some day.