ApplicationDispatcher.java 文件源码

java
阅读 40 收藏 0 点赞 0 评论 0

项目:lazycat 作者:
/**
 * Prepare the request based on the filter configuration.
 * 
 * @param request
 *            The servlet request we are processing
 * @param response
 *            The servlet response we are creating
 * @param state
 *            The RD state
 *
 * @exception IOException
 *                if an input/output error occurs
 * @exception ServletException
 *                if a servlet error occurs
 */
private void processRequest(ServletRequest request, ServletResponse response, State state)
        throws IOException, ServletException {

    DispatcherType disInt = (DispatcherType) request.getAttribute(Globals.DISPATCHER_TYPE_ATTR);
    if (disInt != null) {
        boolean doInvoke = true;

        if (context.getFireRequestListenersOnForwards() && !context.fireRequestInitEvent(request)) {
            doInvoke = false;
        }

        if (doInvoke) {
            if (disInt != DispatcherType.ERROR) {
                state.outerRequest.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR, getCombinedPath());
                state.outerRequest.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.FORWARD);
                invoke(state.outerRequest, response, state);
            } else {
                invoke(state.outerRequest, response, state);
            }

            if (context.getFireRequestListenersOnForwards()) {
                context.fireRequestDestroyEvent(request);
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号