users@glassfish.java.net

Re: servlet: try ... finally {out.close();} <-bad idea?

From: Hassan Schroeder <hassan.schroeder_at_gmail.com>
Date: Sun, 30 May 2010 13:22:02 -0700

On Sun, May 30, 2010 at 10:46 AM, Witold Szczerba <pljosh.mail_at_gmail.com> wrote:

> OK, JSP is for template-based response, and every container is
> supposed to handle it. How about something else like FreeMarker?

Never used it, but it appears to be similar to JSP, though a servlet
container wouldn't be required to implement support for it, since it's
not a standard. I'd guess adding support for it is pretty easy :-)

> Or
> anything non-template-based like JAXB or my own marshaller? The
> container is not going to help with that, request dispatcher is not
> going to forward to such a marshaller, is it?

Does JAXB or your marshaller implement the servlet spec? If not,
then no, or at least nothing good will happen :-)

The separation of concerns in the MVC pattern appeals to me. The
less low-level plumbing I have to deal with, the better. YMMV.

-- 
Hassan Schroeder ------------------------ hassan.schroeder_at_gmail.com
twitter: @hassan