SRV.8.3 include


SRV.8.3 include

The include method of the RequestDispatcher interface may be called at any time. The target servlet has access to all aspects of the request object, but can only write information to the ServletOutputStream or Writer of the response object as well as the ability to commit a response by either writing content past the end of the response buffer or explicitly calling the flush method of the ServletResponse interface. The included servlet cannot set headers or call any method that affects the headers of the response. Any attempt to do so should be ignored.

SRV.8.3.1 Included Request Parameters

When a servlet is being used from within an include , it is sometimes necessary for that servlet to know the path by which it was invoked and not the original request paths. The following request attributes are set:

 javax.servlet.include.request_uri  javax.servlet.include.context_path  javax.servlet.include.servlet_path  javax.servlet.include.path_info  javax.servlet.include.query_string 

These attributes are accessible from the included servlet via the getAttribute method on the ServletRequest object.

If the included servlet was obtained by using a NamedDispatcher , these attributes are not set.



Java 2 Platform, Enterprise Edition. Platform and Component Specifications
Java 2 Platform, Enterprise Edition: Platform and Component Specifications
ISBN: 0201704560
EAN: 2147483647
Year: 2000
Pages: 399

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net