users@glassfish.java.net

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

From: emiddio-verizon <emiddio_at_verizon.net>
Date: Sun, 30 May 2010 11:02:13 -0700

listening to this dialog -- and i still dont quite get it.

JSP is just a servlet -- its not a container; you can compile your jsp into
a servlet.

if the jsp servlet is writing output -- then whats the difference -- one
servlet vs another servlet???

gary


----- Original Message -----
From: "Witold Szczerba" <pljosh.mail_at_gmail.com>
To: <users_at_glassfish.dev.java.net>
Sent: Sunday, May 30, 2010 10:46 AM
Subject: Re: servlet: try ... finally {out.close();} <-bad idea?


> 2010/5/30 Hassan Schroeder <hassan.schroeder_at_gmail.com>:
>> Servlet:
>>
>> Customer customer = Customer.find(customerId);
>> request.setAttribute("customer", customer);
>> RequestDispatcher rd =
>> this.getServletContext().getRequestDispatcher(someViewPage);
>> rd.forward(request, response);
>>
>> JSP (someViewPage):
>>
>> <p>Hello, ${customer.firstName}</p>
>>
>> That's HTML, but you can as easily format as XML, JSON, whatever.
>> The container is responsible for interpreting it and writing the
>> response.
>
> OK, JSP is for template-based response, and every container is
> supposed to handle it. How about something else like FreeMarker? 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?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>