Package javax.servlet

Examples of javax.servlet.RequestDispatcher.include()


    request.setAttribute(Constant.session_portlet_bean_map, portletsMap);
    //            request.setAttribute(Constant.session_portlet_bean_list, portletsBean);
    response.setHeader("Content-Type", "text/html");
    servletDispatcher = context.getRequestDispatcher("/WEB-INF/jsp/tck.jsp");
    servletDispatcher.include(request, response);



  }
View Full Code Here


            throw new IOException("No request dispatcher returned for path '"
                    + path + "'");
        }

        try {
            rd.include(request, response);
        } catch (ServletException ex) {
            throw wrapServletException(ex, "ServletException including path '"
                    + path + "'.");
        }
    }
View Full Code Here

                throw new IllegalArgumentException("Cannot find included file " + aName);
            }

            ResponseWrapper responseWrapper = new ResponseWrapper(aResponse);

            dispatcher.include(aRequest, responseWrapper);

            return responseWrapper.getData();
        }
        catch (Exception e) {
            e.printStackTrace();
View Full Code Here

            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);
    }

    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

                }
            }
        }

        try {
            rd.include(request, response);
        } catch (IOException ie) {
            throw new ViewHandlerException("IO Error in view", ie);
        } catch (ServletException e) {
            Throwable throwable = e.getRootCause() != null ? e.getRootCause() : e;
View Full Code Here

               
                servletRequest.setAttribute(Constants.METHOD_ID, methodID);
                servletRequest.setAttribute(Constants.PORTLET_REQUEST, request);
                servletRequest.setAttribute(Constants.PORTLET_RESPONSE, response);
               
                dispatcher.include(servletRequest, servletResponse);

            } catch (javax.servlet.UnavailableException ex) {
                int seconds = ex.isPermanent()?-1:ex.getUnavailableSeconds();
                String message =  EXCEPTIONS.getString(
                    "error.portlet.invoker.unavailable",
View Full Code Here

    else if (_out instanceof FlushBuffer)
      ((FlushBuffer) _out).flushBuffer();
    else if (flush)
      _out.flush();

    rd.include(req, res);
  }

  /**
   * Include another servlet into the current output stream.
   *
 
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

        HttpServletResponse resp = (HttpServletResponse) externalContext.getResponse();
        String path = "/portal/SingleTile.jsp?portlet=.dashContent.searchResources";
//        path = "/Dashboard.do";
        RequestDispatcher dispatcher = req.getRequestDispatcher(path);
        try {
            dispatcher.include(req, resp);
        } catch (ServletException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        } catch (IOException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
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.