There is an advantage to using response.sendRedirect() - when users try to
print a page that is the result of a form POST from certain Netscape
browsers, the page prints blank, or with an error message; I've even seen
it strip the query string for the purposes of printing. Using
response.sendRedirect() I believe would get around this problem with some
Netscape browser versions.
Of course this is irrelevant if users aren't interested in printing the
resulting page, but believe it or not I've seen users try to print an
entire Web site, input screens and all!
Eric M. Andersen
I/T Specialist
IBM Global Services
Tel: (781) 895-2637, Fax : (781) 895-2843, t/line : 362-2637
Internet ID: [EMAIL PROTECTED]
Lotus Notes ID: Eric M Andersen/Waltham/IBM
"Craig R. McClanahan" <[EMAIL PROTECTED]>@JAVA.SUN.COM> on
01/26/2000 07:08:21 PM
Please respond to "Craig R. McClanahan" <[EMAIL PROTECTED]>
Sent by: A mailing list about Java Server Pages specification and
reference <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc:
Subject: Re: design question
O'Meara AnnMarie wrote:
> I currently have some Servlets that take form data from the request,
update a
> database, and then forward to another page (using res.sendRedirect()).
>
> My question is: is there any reason I should convert them to JSPs? I'm
using
> the MVC model (with a generic Controller Servlet) and JSPs + beans to
display
> pages to the user, but what about these "invisible" Servlets?
>
By "them", are you talking about the servlets that receive and process the
requests? If so, I would not change them -- my basic rule is "if it's
visible, use
JSP pages; if it's not visible, use servlets." You can technically use an
"invisible" JSP page to play this role, but I cannot think of a compelling
reason
to do so.
One thing you might also consider is using RequestDispatcher.forward()
insted of
response.sendRedirect() to switch from the servlet to the JSP page to
display the
results. This saves an extra round trip to the browser, so it will run
faster.
>
> Am I doing something silly or missing something here?
>
Craig McClanahan
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> FAQs on JSP can be found at:
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html