File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes Does Number of Servlets affetcs Performance.... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Does Number of Servlets affetcs Performance...." Watch "Does Number of Servlets affetcs Performance...." New topic

Does Number of Servlets affetcs Performance....

senthil nathan

Joined: Jun 14, 2002
Posts: 17
I'm developing a application which has 7 screens.We are coding in the following manner.
Control will come to Servlet and this servlet will decide from which screen control came from and we will send the request to Business Object(BO) class where database connections will be done and datas will be retreived and stored in a bean.Now control will return to the same i should transfer the control to the jsp for presentation.The problem is i was asked to write one servlet which transfer control to corresponding BO class and link to jsp.Reason tehy are saying is they are reducing the number of servlets...Any way we are going to convert it into WAR file or so...So does the Number of Servlets really is a concern....
Thanks in Adv.
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
Having one or a dozen servlets should not make any difference in response speed as long as the single servlet doesn't grab resources it doesn't really need for a particular request. In other words, the servlet should not grab a db connection unless you need it, etc. - sounds like you have already taken care of that.
Having a single servlet will probably be easier to debug.
Jessica Sant

Joined: Oct 17, 2001
Posts: 4313

"senthil nathan2002"-
Welcome to the JavaRanch! Please adjust your displayed name to match the JavaRanch Naming Policy.
You can change it here.
Thanks! and again welcome to the JavaRanch!
sandy gupta
Ranch Hand

Joined: Jan 30, 2001
Posts: 228
I feel that having multiple servlets is a better idea(unless u feel like annihilating the web servers resources with servlets) as it is easier at the time of debugging if u have different controllers. That way, u can get one of the business units out of the picture if it starts giving a problem, debug it and then put it back in, unlike the other case where all u'r BO's will depend on 1 servlet.
This is one of those business decisions where the designers acumen and the years of experience play a vital role.

I agree. Here's the link:
subject: Does Number of Servlets affetcs Performance....
jQuery in Action, 3rd edition