Package javax.servlet

Examples of javax.servlet.RequestDispatcher.include()


            throw new IllegalArgumentException("HttpServletRequest returned a null RequestDispatcher for: [" + content + "]");
        } else {
            // Exception newE = new Exception("Stack Trace");
            // Debug.logInfo(newE, "Got RD for: [" + content + "]: " + rd.toString(), module);
        }
        rd.include(request, response);
    }

    @Override
    public String toString() {
        String s = "Region: " + content + ", type=" + type;
View Full Code Here


                request.setAttribute("_ERROR_OCCURRED_", Boolean.TRUE);
                Debug.logError("Including errorPage: " + errorPage, module);

                // NOTE DEJ20070727 after having trouble with all of these, try to get the page out and as a last resort just send something back
                try {
                    rd.include(request, response);
                } catch (Throwable t) {
                    Debug.logWarning("Error while trying to send error page using rd.include (will try response.getOutputStream or response.getWriter): " + t.toString(), module);

                    String errorMessage = "ERROR rendering error page [" + errorPage + "], but here is the error text: " + request.getAttribute("_ERROR_MESSAGE_");
                    try {
View Full Code Here

            // include the resource, using our custom wrapper
            ImportResponseWrapper irw =
                new ImportResponseWrapper((HttpServletResponse)response);
            try
            {
                rd.include(request, irw);
            }
            catch (IOException ex)
            {
                throw new Exception("Problem importing the relative URL \""
                                    + url + "\". " + ex);
View Full Code Here

                    dispatcher = getServletContext().getNamedDispatcher(
                            context.getPath());
                else
                    dispatcher = getServletContext().getRequestDispatcher(
                            context.getPath());
                dispatcher.include(request, response);
                return true;
            }
        }
        return false;
    }
View Full Code Here

                }
               
                req.setAttribute(StrutsPortlet.REQUEST_TYPE, requestType);
                try
                {
                    rd.include(new PortletServletRequestWrapper(servletContext, req), res);
                }
                catch (ServletException e)
                {
                    if (log.isErrorEnabled())
                        log.error("Include exception", e);
View Full Code Here

            }

            if (dispatcher != null) {
                SlingHttpServletResponse response = new JspSlingHttpServletResponseWrapper(
                    pageContext);
                dispatcher.include(request, response);
            } else {
                TagUtil.log(log, pageContext, "No content to include...", null);
            }

        } catch (IOException ioe) {
View Full Code Here

                        // Forward to the index
                        RequestDispatcher dispatcher=request.getRequestDispatcher(ipath);
                        if (dispatcher!=null)
                        {
                            if (included.booleanValue())
                                dispatcher.include(request,response);
                            else
                            {
                                request.setAttribute("org.mortbay.jetty.welcome",ipath);
                                dispatcher.forward(request,response);
                            }
View Full Code Here

                    }
                }
                req.setAttribute(SERVLET_PORTLET_APPLICATION_SESSION, req.getSession());
                try
                {
                    rd.include(new PortletServletRequestWrapper(servletContext, req, proxiedSession), res);
                }
                catch (ServletException e)
                {
                    if (log.isErrorEnabled())
                        log.error("Include exception", e);
View Full Code Here

                    dispatcher = getServletContext().getNamedDispatcher(
                            context.getPath());
                else
                    dispatcher = getServletContext().getRequestDispatcher(
                            context.getPath());
                dispatcher.include(request, response);
                return true;
            }
        }
        return false;
    }
View Full Code Here

                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);
                    requestDispatcher.include(servletRequest, servletResponse);
                }catch (Exception x) {
                    //log.error("Async.dispatch",x);
                    throw new RuntimeException(x);
                }finally {
                    request.setAttribute(Globals.DISPATCHER_TYPE_ATTR, type);
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.