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

Reply via email to