• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Component dispatcher sevlet

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

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,
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Kriss Reddy
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
BTW: your entire app doesn't have to go through one servlet.

I have a controller for each component.
 
Vani Nandeesh
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you have multiple controllers, then do you have another servlet to control the flow to theses servlets.
How does it work?

Thanks.
 
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Lee and Srinivas. My question is answered.
 
Stan James
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks All.

Have a nice weekend.
reply
    Bookmark Topic Watch Topic
  • New Topic