Examples of DispatcherType


Examples of javax.servlet.DispatcherType

            private static final long serialVersionUID = 1L;

            @Override
            protected void doGet(final HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException
            {
                DispatcherType dispatcherType = req.getDispatcherType();
                if (DispatcherType.REQUEST == dispatcherType)
                {
                    final AsyncContext asyncContext = req.startAsync(req, resp);
                    asyncContext.start(new Runnable()
                    {
View Full Code Here

Examples of javax.servlet.DispatcherType

            requestImpl.setAttribute(INCLUDE_PATH_INFO, pathMatch.getRemaining());
            requestImpl.setAttribute(INCLUDE_QUERY_STRING, newQueryString);
        }
        boolean inInclude = responseImpl.isInsideInclude();
        responseImpl.setInsideInclude(true);
        DispatcherType oldDispatcherType = servletRequestContext.getDispatcherType();

        ServletContextImpl oldContext = requestImpl.getServletContext();
        try {
            requestImpl.setServletContext(servletContext);
            responseImpl.setServletContext(servletContext);
View Full Code Here

Examples of javax.servlet.DispatcherType

        final HttpServletResponse servletResponse = (HttpServletResponse)getResponse();
        Runnable run = new Runnable() {
            @Override
            public void run() {
                request.getCoyoteRequest().action(ActionCode.ASYNC_DISPATCHED, null);
                DispatcherType type = (DispatcherType)request.getAttribute(Globals.DISPATCHER_TYPE_ATTR);
                try {
                    //piggy back on the request dispatcher to ensure that filters etc get called.
                    //TODO SERVLET3 - async should this be include/forward or a new dispatch type
                    //javadoc suggests include with the type of DispatcherType.ASYNC
                    request.setAttribute(Globals.DISPATCHER_TYPE_ATTR, DispatcherType.ASYNC);
View Full Code Here

Examples of javax.servlet.DispatcherType

            comet = true;
            request.setComet(true);
        }
       
        MessageBytes requestPathMB = request.getRequestPathMB();
        DispatcherType dispatcherType = DispatcherType.REQUEST;
        if (request.getDispatcherType()==DispatcherType.ASYNC) dispatcherType = DispatcherType.ASYNC;
        request.setAttribute(Globals.DISPATCHER_TYPE_ATTR,dispatcherType);
        request.setAttribute(Globals.DISPATCHER_REQUEST_PATH_ATTR,
                requestPathMB);
        // Create the filter chain for this request
View Full Code Here

Examples of javax.servlet.DispatcherType

                requestImpl.setAttribute(INCLUDE_SERVLET_PATH, pathMatch.getMatched());
                requestImpl.setAttribute(INCLUDE_PATH_INFO, pathMatch.getRemaining());
            }
            boolean inInclude = responseImpl.isInsideInclude();
            responseImpl.setInsideInclude(true);
            DispatcherType oldDispatcherType = servletRequestContext.getDispatcherType();

            ServletContextImpl oldContext = requestImpl.getServletContext();
            try {
                requestImpl.setServletContext(servletContext);
                responseImpl.setServletContext(servletContext);
View Full Code Here

Examples of javax.servlet.DispatcherType

    @Override
    public void handleRequest(final HttpServerExchange exchange) throws Exception {
        ServletRequest request = exchange.getAttachment(HttpServletRequestImpl.ATTACHMENT_KEY);
        ServletResponse response = exchange.getAttachment(HttpServletResponseImpl.ATTACHMENT_KEY);
        DispatcherType dispatcher = exchange.getAttachment(HttpServletRequestImpl.DISPATCHER_TYPE_ATTACHMENT_KEY);
        Boolean supported = asyncSupported.get(dispatcher);
        if(supported != null && ! supported) {
            exchange.putAttachment(AsyncContextImpl.ASYNC_SUPPORTED, false    );
        }
View Full Code Here

Examples of javax.servlet.DispatcherType

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        /*
         * Where a servlet has received a POST request we still require the capability to include static content.
         */
        DispatcherType dispatchType = req.getDispatcherType();
        switch (req.getDispatcherType()) {
            case INCLUDE:
            case FORWARD:
                doGet(req, resp);
                break;
View Full Code Here

Examples of javax.servlet.DispatcherType

    private void processRequest(ServletRequest request,
                                ServletResponse response,
                                State state)
        throws IOException, ServletException {
               
        DispatcherType disInt = (DispatcherType) request.getAttribute(ApplicationFilterFactory.DISPATCHER_TYPE_ATTR);
        if (disInt != null) {
            if (disInt != DispatcherType.ERROR) {
                state.outerRequest.setAttribute
                    (ApplicationFilterFactory.DISPATCHER_REQUEST_PATH_ATTR,
                     getCombinedPath());
View Full Code Here

Examples of javax.servlet.DispatcherType

                if (e instanceof ServletException)
                    throw (ServletException) e;
                throw (IOException) e;
            }
        } else {
            DispatcherType type = DispatcherType.INCLUDE;
            if (request.getDispatcherType()==DispatcherType.ASYNC) type = DispatcherType.ASYNC;
            doInclude(request,response,type);
        }
    }
View Full Code Here

Examples of javax.servlet.DispatcherType

            this.response = response;
        }

        @Override
        public Void run() throws ServletException, IOException {
            DispatcherType type = DispatcherType.INCLUDE;
            if (request.getDispatcherType()==DispatcherType.ASYNC) type = DispatcherType.ASYNC;
            doInclude(request,response,type);
            return null;
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.