This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
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?
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.
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 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.
Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>