Package javax.servlet

Examples of javax.servlet.RequestDispatcher.include()


            response.sendError(
                HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
                getInternal().getMessage("requestDispatcher", uri));
            return;
        }
        rd.include(request, response);
    }


    // -------------------------------------------------------- Support Methods
View Full Code Here


            }
            ByteArrayServletOutputStream basos =
                new ByteArrayServletOutputStream();
            ResponseIncludeWrapper responseIncludeWrapper =
                new ResponseIncludeWrapper(context, req, res, basos);
            rd.include(req, responseIncludeWrapper);
            //We can't assume the included servlet flushed its output
            responseIncludeWrapper.flushOutputStreamOrWriter();
            byte[] bytes = basos.toByteArray();

            //Assume platform default encoding unless otherwise specified
View Full Code Here

        ServletResponseWrapper responseWrapper =
        new ServletResponseWrapperForWriter(
        response, new PrintWriter(writer));
        rd = pageContext.getServletContext().getRequestDispatcher(name);
        try {
            rd.include(request, responseWrapper);
            return ioBean.getReader();
        } catch (Exception ex) {
            throw new JspException(ex);
        }
    }
View Full Code Here

            ImportResponseWrapper irw =
                new ImportResponseWrapper(pageContext);
           
            // spec mandates specific error handling form include()
            try {
                rd.include(pageContext.getRequest(), irw);
            } catch (IOException ex) {
                throw new JspException(ex);
            } catch (RuntimeException ex) {
                throw new JspException(ex);
            } catch (ServletException ex) {
View Full Code Here

        rsp.setHeader("Location",path);

        // ... but first let the container authenticate this request
        RequestDispatcher d = servletContext.getRequestDispatcher("/j_security_check?j_username="+
            URLEncoder.encode(username,"UTF-8")+"&j_password="+URLEncoder.encode(password,"UTF-8"));
        d.include(req,rsp);
    }

    //public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
    //    HttpServletRequest req = (HttpServletRequest) request;
    //    String authorization = req.getHeader("Authorization");
View Full Code Here

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

        try {
            responseWrapper = new StringWriterResponse(slingResponse);
            final RequestDispatcher requestDispatcher = slingRequest.getRequestDispatcher(path);

            requestDispatcher.include(slingRequest, responseWrapper);

            return StringUtils.stripToNull(responseWrapper.getString());
        } catch (Exception ex) {
            log.error("Error creating the String representation for: {} -- {}", path, ex);
        } finally {
View Full Code Here

                || errorImagesEnabled && this.isImageRequest(request)) {
            final RequestDispatcher dispatcher = request.getRequestDispatcher(path);

            if (dispatcher != null) {
                try {
                    dispatcher.include(new GetRequest(request), response);
                } catch (Exception e) {
                    log.debug("Exception swallowed while including error page", e);
                }
            }
        } else {
View Full Code Here

        Object value = TPrequest.getAttribute(attribute);
        request.setAttribute(attribute, value);
      }
      servletDispatcher = TPresponse.getDispatcher();
      HttpServletResponse newResponse = new FictiveHttpServletResponse((HttpServletResponse) response, TPresponse);       
      servletDispatcher.include(request, newResponse);
      portletHolder.setContent(newResponse.toString());
    } else {
      portletHolder.setContent(TPresponse.getStringContent());
    }
View Full Code Here

      //      request.setAttribute(Constant.session_portlet_bean_list, portletsBean);
      response.setHeader("Content-Type", "text/html");

      ServletContext context = getServletContext();
      servletDispatcher = context.getRequestDispatcher(portalJsp);
      servletDispatcher.include(request, response);

    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
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.