This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
What is a Component dispatcher sevlet? and how it works?
If the question is too basic give me some pointers where I could look in for more info.
Thanks,
Kriss.
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
posted
0
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
Kriss Reddy
Ranch Hand
Joined: Mar 29, 2005
Posts: 54
posted
0
Hey Stan,
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'.
Thanks again.
Vani Nandeesh
Greenhorn
Joined: Mar 31, 2005
Posts: 3
posted
0
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.
If you have multiple controllers, then do you have another servlet to control the flow to theses servlets. How does it work?
Thanks.
Heonkoo Lee
Ranch Hand
Joined: Feb 10, 2005
Posts: 85
posted
0
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?
Thanks.
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.
Regards
Srinivas Ivaturi
Ranch Hand
Joined: Jan 28, 2003
Posts: 50
posted
0
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".
Srinivas Ivaturi.
Vani Nandeesh
Greenhorn
Joined: Mar 31, 2005
Posts: 3
posted
0
Thanks Lee and Srinivas. My question is answered.
Stan James
(instanceof Sidekick)
Ranch Hand
Joined: Jan 29, 2003
Posts: 8791
posted
0
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.
Kriss Reddy
Ranch Hand
Joined: Mar 29, 2005
Posts: 54
posted
0
Thanks All.
Have a nice weekend.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.