Hi All,
My question is relevant to the servlets design issue.
Let's say I have an application that uses several servlets.
By default, the "Login servlet" is called.
The "login servlet" calls a "Menu servlet" using
sendRedirect(encodeRedirectURL("/servlet/Menu")).
The "Menu servlet" calls other servlets using the hyperlink.
Let's say "Search Address" or "Search Names" servlets. It is impossible to
combine all servlets into one because of different functionalities.
1) Are there any better design techniques?
2) Any performance issues due to the fact that several servlets are called
one after another?
3) Should I always call the servlets using encodeURL to keep the session
active?
Please advice. Thanks.
>From: Nic Ferrier <[EMAIL PROTECTED]>
>Reply-To: "A mailing list for discussion about Sun Microsystem's Java
> Servlet API Technology." <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: Re: servlet design issue
>Date: Thu, 28 Oct 1999 03:44:50 +0100
>
> >>> Brian McMullan <[EMAIL PROTECTED]> 27/10/99 23:15:01 >>>
>
> >Is there a performance advantage to chaining
> >several servlets together? What is the usual
> >practice?
>
>There is a small performance hit associated with using
>RequestDispatchers to chain servlets together. This can become serious
>if you are doing *a lot* of redirecting amongst servlets (which is
>very unusual).
>
>
>In the past James Duncan Davidson has argued (and I tend to agree
>with him) that servlets are like a main() method in that they simply
>provide an entry point for running a program over the web.
>
>Looking at it this way means you build one servlet and have that talk
>to many sub-objects. This can be quite a tidy and efficient system as
>opposed to having many servlets.
>
>The times I use more than one servlet are when there is a resonable
>difference in functionality between the servlets themselves.
>
>For example, in a simple banking app you might have a servlet to deal
>with the main menu, a servlet to handle the current account screen and
>a servlet to handle the deposit acount.
>
>Alternately you can do it by class of object, in this case you would
>have a servlet for account type pages and another for menu type
>pages.
>
>I would say that if your system uses a single template you only need
>one servlet.
>
>
>It is one of the most confusing design aspects of servlets this "one
>or many" question so don't worry if it causes you some problems.
>
>
>Nic Ferrier
>
>___________________________________________________________________________
>To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
>of the message "signoff SERVLET-INTEREST".
>
>Archives: http://archives.java.sun.com/archives/servlet-interest.html
>Resources: http://java.sun.com/products/servlet/external-resources.html
>LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html