SRV.8.3 includeThe 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 ParametersWhen 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. |