tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shapira, Yoav" <>
Subject RE: RequestDispatcher anomolies (Tomcat v4.1.24)
Date Tue, 17 Jun 2003 15:22:00 GMT


>One: as noted, return explicitly from the executing method OR

I like this one, as it's clear and simple.  If you forward somewhere you
shouldn't be doing anything in the method afterwards.

>Two: explictly use out.close() in the called resource. (not useful when
>the called resource is static HTML with a JSP extension to support HTTP
>POST I guess)

Possibly worse than not useful, given the presence of Servlet 2.3
HttpServletResponseWrapper, and filters.  Both of those may want to do
stuff with the output stream and they may choke if the stream is closed.
And this may become even worse with Servlet 2.4 ResponseListeners.

So that's why I like the first approach better.  Seeing as how your book
was well-written enough to note control is returned after calling
RequestDispatcher#forward, I must assume the book was written before
Servlet 2.3 came out, or it wouldn't have listed the 2nd approach ;)

Yoav Shapira 

This e-mail, including any attachments, is a confidential business communication, and may
contain information that is confidential, proprietary and/or privileged.  This e-mail is intended
only for the individual(s) to whom it is addressed, and may not be saved, copied, printed,
disclosed or used by anyone else.  If you are not the(an) intended recipient, please immediately
delete this e-mail from your computer system and notify the sender.  Thank you.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message