Forwarding to Another Page

In addition to including another page, you can transfer to another page without returning to the original. This technique is called forwarding. When you forward the request on to another page (or servlet), the forwarding page is no longer involved in handling the request. You typically would use forwarding to handle an error, or if you need several different response pages that depend on the data in the request. In the latter case, you would use a JSP or a servlet to look at the incoming request, decide which response page to use, and forward the request on to that page.

Forwarding to Another Page from a JSP

The JSP syntax for forwarding is very similar to the syntax for including. You use the <jsp:forward> tag like ...

Get Special Edition Using Java™ 2 Enterprise Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.