/** * Forwards the given request and response to the resource * for which this dispatcher was acquired. * * <p>Any runtime exceptions, IOException, or ServletException thrown * by the target will be propagated to the caller. * * @param request The request to be forwarded * @param response The response to be forwarded * * @throws IOException if an input/output error occurs * @throws ServletException if a servlet exception occurs */ @Override public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException { dispatch(request, response, DispatcherType.FORWARD); }
doInvoke(request, response, crossContext, state); } finally { crossContextFlag = null;
/** * Prepare the request based on the filter configuration. * * @param request The servlet request we are processing * @param response The servlet response we are creating * * @throws IOException if an input/output error occurs * @throws ServletException if a servlet error occurs */ private void processRequest(ServletRequest request, ServletResponse response, State state) throws IOException, ServletException { if (request != null) { if (state.dispatcherType != DispatcherType.ERROR) { state.outerRequest.setAttribute( Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); invoke(state.outerRequest, response, state); } else { invoke(state.outerRequest, response, state); } } }
wrapResponse(state); DispatchedHttpServletRequest wrequest = (DispatchedHttpServletRequest) wrapRequest(state); wrequest.setAttribute(Globals.NAMED_DISPATCHER_ATTR, name); if (servletPath != null) wrequest.setServletPath(servletPath); wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); try{ invoke(state.outerRequest, state.outerResponse, state); } finally { recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state); DispatchedHttpServletRequest wrequest = (DispatchedHttpServletRequest) wrapRequest(state); wrequest.initSpecialAttributes(requestURI, wrapper.getContextPath(), wrequest.setQueryParams(queryString); wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); try{ invoke(state.outerRequest, state.outerResponse, state); } finally { recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state);
dtInfo.addDispatchTarget(getCombinedPath(), false); ServletRequest sr = wrapRequest(state); wrapResponse(state); processRequest(request, response, state); } else if ((servletPath == null) && (pathInfo == null)) { wrequest.setQueryString(hrequest.getQueryString()); processRequest(request, response, state); processRequest(request, response, state); recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state);
closeResponse( response ); doDispatch(request, response, dispatcherType); closeResponse( response );
return new ApplicationDispatcher(wrapper, null, null, null, null, name);
/** * Include the response from another resource in the current response. * Any runtime exception, IOException, or ServletException thrown by the * called servlet will be propagated to the caller. * * @param request The servlet request that is including this one * @param response The servlet response to be appended to * * @throws IOException if an input/output error occurs * @throws ServletException if a servlet exception occurs */ @SuppressWarnings( "unchecked" ) @Override public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException { if (System.getSecurityManager() != null) { try { PrivilegedInclude dp = new PrivilegedInclude(request,response); AccessController.doPrivileged(dp); } catch (PrivilegedActionException pe) { Exception e = pe.getException(); if (e instanceof ServletException) throw (ServletException) e; throw (IOException) e; } } else { doInclude(request,response); } }
wrapResponse(state); DispatchedHttpServletRequest wrequest = (DispatchedHttpServletRequest) wrapRequest(state); wrequest.setAttribute(Globals.NAMED_DISPATCHER_ATTR, name); if (servletPath != null) wrequest.setServletPath(servletPath); wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); try{ invoke(state.outerRequest, state.outerResponse, state); } finally { recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state); DispatchedHttpServletRequest wrequest = (DispatchedHttpServletRequest) wrapRequest(state); wrequest.initSpecialAttributes(requestURI, wrapper.getContextPath(), wrequest.setQueryParams(queryString); wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); try{ invoke(state.outerRequest, state.outerResponse, state); } finally { recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state);
dtInfo.addDispatchTarget(getCombinedPath(), false); ServletRequest sr = wrapRequest(state); wrapResponse(state); processRequest(request, response, state); } else if ((servletPath == null) && (pathInfo == null)) { wrequest.setQueryString(hrequest.getQueryString()); processRequest(request, response, state); processRequest(request, response, state); recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state);
closeResponse( response ); doDispatch(request, response, dispatcherType); closeResponse( response );
return new ApplicationDispatcher(wrapper, null, null, null, null, name);
/** * Include the response from another resource in the current response. * Any runtime exception, IOException, or ServletException thrown by the * called servlet will be propagated to the caller. * * @param request The servlet request that is including this one * @param response The servlet response to be appended to * * @throws IOException if an input/output error occurs * @throws ServletException if a servlet exception occurs */ @SuppressWarnings( "unchecked" ) @Override public void include(ServletRequest request, ServletResponse response) throws ServletException, IOException { if (System.getSecurityManager() != null) { try { PrivilegedInclude dp = new PrivilegedInclude(request,response); AccessController.doPrivileged(dp); } catch (PrivilegedActionException pe) { Exception e = pe.getException(); if (e instanceof ServletException) throw (ServletException) e; throw (IOException) e; } } else { doInclude(request,response); } }
wrapResponse(state); DispatchedHttpServletRequest wrequest = (DispatchedHttpServletRequest) wrapRequest(state); wrequest.setAttribute(Globals.NAMED_DISPATCHER_ATTR, name); if (servletPath != null) wrequest.setServletPath(servletPath); wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); try{ invoke(state.outerRequest, state.outerResponse, state); } finally { recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state); DispatchedHttpServletRequest wrequest = (DispatchedHttpServletRequest) wrapRequest(state); wrequest.initSpecialAttributes(requestURI, wrapper.getContextPath(), wrequest.setQueryParams(queryString); wrequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); try{ invoke(state.outerRequest, state.outerResponse, state); } finally { recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state);
dtInfo.addDispatchTarget(getCombinedPath(), false); ServletRequest sr = wrapRequest(state); wrapResponse(state); processRequest(request, response, state); } else if ((servletPath == null) && (pathInfo == null)) { wrequest.setQueryString(hrequest.getQueryString()); processRequest(request, response, state); processRequest(request, response, state); recycleRequestWrapper(state); unwrapRequest(state); unwrapResponse(state);
/** * Prepare the request based on the filter configuration. * * @param request The servlet request we are processing * @param response The servlet response we are creating * * @throws IOException if an input/output error occurs * @throws ServletException if a servlet error occurs */ private void processRequest(ServletRequest request, ServletResponse response, State state) throws IOException, ServletException { if (request != null) { if (state.dispatcherType != DispatcherType.ERROR) { state.outerRequest.setAttribute( Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath()); invoke(state.outerRequest, response, state); } else { invoke(state.outerRequest, response, state); } } }
closeResponse( response ); doDispatch(request, response, dispatcherType); closeResponse( response );
/** * Forwards the given request and response to the resource * for which this dispatcher was acquired. * * <p>Any runtime exceptions, IOException, or ServletException thrown * by the target will be propagated to the caller. * * @param request The request to be forwarded * @param response The response to be forwarded * * @throws IOException if an input/output error occurs * @throws ServletException if a servlet exception occurs */ @Override public void forward(ServletRequest request, ServletResponse response) throws ServletException, IOException { dispatch(request, response, DispatcherType.FORWARD); }
return new ApplicationDispatcher(wrapper, null, null, null, null, name);
doInvoke(request, response, crossContext, state); } finally { crossContextFlag = null;