Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
HydraExpress Servlet Development Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

8.8 Forwarding a Request

A servlet or filter can forward a request to a different filter or servlet in the same container, or to any HTTP URL. For example, the filter code below forwards a request to a servlet named ServletTwo.

Requests forwarded within a container bypass any filter chain for the destination. So, in the example above, if ServletTwo relies on a filter to uncompress the payload of the request, that filter will not be called when the request is forwarded.

A request dispatcher can target any HTTP URL reachable by the container. The following servlet code forwards a request to a remote Web page.

Dispatching a request to an HTTP URL does not redirect the client to the remote Web page. Instead, the servlet container retrieves the remote Web page and returns the Web page to the client. The client has no knowledge of the original source of the Web page. In general, this means that a client will not be able to load images from the returned Web page, that relative links reference the container rather than the original resource, and so on. This technique is useful for dispatching Web service requests to another machine for processing.



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved. All Rights Reserved. Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. HydraExpress is a trademark of Rogue Wave Software, Inc. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.