Example usage for javax.servlet RequestDispatcher INCLUDE_QUERY_STRING

List of usage examples for javax.servlet RequestDispatcher INCLUDE_QUERY_STRING

Introduction

In this page you can find the example usage for javax.servlet RequestDispatcher INCLUDE_QUERY_STRING.

Prototype

String INCLUDE_QUERY_STRING

To view the source code for javax.servlet RequestDispatcher INCLUDE_QUERY_STRING.

Click Source Link

Document

The name of the request attribute under which the query string of the target of an #include(ServletRequest,ServletResponse) include is stored

Usage

From source file:org.ireland.jnetty.webapp.RequestDispatcherImpl.java

private void doInclude(HttpServletRequest request, HttpServletResponse response, HttpInvocation invocation)
        throws ServletException, IOException {

    //Wrap the request
    IncludeRequest wrequest = new IncludeRequest(request, response, invocation);

    // If we have already been include previously, then keep using the established
    // original value. Otherwise, this is the first include and we need to establish the values.
    // Note: the established value on the original request for pathInfo and
    // for queryString is allowed to be null, but cannot be null for the other values.
    if (request.getAttribute(RequestDispatcher.INCLUDE_REQUEST_URI) == null) {
        // ?Include,
        wrequest.setAttribute(RequestDispatcher.INCLUDE_REQUEST_URI, request.getRequestURI());

        wrequest.setAttribute(RequestDispatcher.INCLUDE_CONTEXT_PATH, request.getContextPath());
        wrequest.setAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH, request.getServletPath());
        wrequest.setAttribute(RequestDispatcher.INCLUDE_PATH_INFO, request.getPathInfo());
        wrequest.setAttribute(RequestDispatcher.INCLUDE_QUERY_STRING, request.getQueryString());
    }/*from  www  . ja va 2s.  com*/

    boolean isValid = false;

    try {

        invocation.getFilterChainInvocation().service(wrequest, response);

        isValid = true;
    } finally {
        if (request.getAsyncContext() != null) {
            // An async request was started during the forward, don't close the
            // response as it may be written to during the async handling
            return;
        }

        // server/106r, ioc/0310
        if (isValid) {
            finishResponse(response);
        }
    }
}