• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Front Controller

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am new to the design patterns.I came across the front controller pattern,which is a servlet handling all the request coming from the client.
But its confusing me.Becasue if a single resource handles all the request wont it be a petformnace bottle neck?I guess it will hit the performance and the load the controller servelt.if there are 1000 simultaneaous request there wil be 1000 thread spawn for the controller servlet.Please correct me if I am wrong.Can anybody give me some information how this works out to be?

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


I guess it will hit the performance and the load the controller servelt.



It's always better to load the controller servlet at the starting of the server, using <load-on-startup> element in DD. Struts implements Front Controller. ActionServlet is the controller servlet there which handles everything for you and the good thing about it is you don't have to write any implementation code for it. Struts provides the implementation and you can use struts-config.xml file to declaratively control the invocation sequence of model and view components.
 
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
pravegam ck,
Welcome to JavaRanch!

We're pleased to have you here with us in the servlets forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

You can change it here
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can neglect dispatching overhead. You have much worse overhead in Apache-Tomcat connectors. You can expect also that not every servlet container will spawn 1000 threads, requests are usually queued. Actually a selector in Java 5 allows to handle hundred thousands requests just by one thread.
reply
    Bookmark Topic Watch Topic
  • New Topic