On Tue, 12 Oct 1999, Andy Bailey wrote:

> > You don't need more then one servlet for one application.
> > Use method HttpServlet.service() instead of doGet() or doPost(),
> > use HttpServletRequest.getPathInfo() or existence of some parameters
> > to distinguish what page to show.
>
> I would seriously question the idea that you never need more than
> one servlet per application. You should plan on having one servlet
> for each task that is part of the application and if you abstract
> things properly you can reduce this number usually.

I think he was talking in the context of the prior discussion -- that
multiple servlets were not necessary due to using the second of the
two approaches suggested in the original post in this thread.

Even so, you don't *need* to have more than one servlet per
application.  It may (or may not) be a good idea, depending on the
particulars of the application and what the servlet(s) will be used
for.  Typically, something between one servlet per application and one
servlet per each task in the application will work out best.


> It is also a bad idea to override the servlet service method as that
> is usually implemented by the ServletEngine vendor to route requests
> to the right place.

Agreed.  I also was a little unsure about his comment that GET's had
to be used for static pages and POST's worked better for dynamic pages.


> If you try and have one servlet that does all you are placing all
> your eggs in one basket.  You will end up with a large, hard to
> maintain and badly implemented servlet that will never end up doing
> things as you it to in the first place.

I think this depends on the particulars of the application/situation.

Milt Epstein
Research Programmer
Software/Systems Development Group
Computing and Communications Services Office (CCSO)
University of Illinois at Urbana-Champaign (UIUC)
[EMAIL PROTECTED]

___________________________________________________________________________
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

Reply via email to