Package javax.portlet

Examples of javax.portlet.PortletRequestDispatcher


   public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException
   {
      String sYourName = (String) request.getParameter("yourname");
      if (sYourName != null)
      {
         PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/hello.jsp");
         prd.include(request, response);
      }
      else
      {
         PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/welcome.jsp");
         prd.include(request, response);
      }
   }
View Full Code Here


   protected void doHelp(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
         UnavailableException
   {
      rResponse.setContentType("text/html");
      PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/help.jsp");
      prd.include(rRequest, rResponse);
   }
View Full Code Here

   protected void doEdit(RenderRequest rRequest, RenderResponse rResponse) throws PortletException, IOException,
         UnavailableException
   {
      rResponse.setContentType("text/html");
      PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/edit.jsp");
      prd.include(rRequest, rResponse);
   }
View Full Code Here

    {
      response.setContentType(request.getResponseContentType());
    }
    try
    {
      PortletRequestDispatcher dispatcher =
        this.getPortletContext().getRequestDispatcher(targetPath);
      dispatcher.include(request, response);
      return true;
    } catch (Exception e)
    {
      throw new PortletException("Unable to dispatch to: " + targetPath, e);
    }
View Full Code Here

    if (getPortletPhase() == Bridge.PortletPhase.ACTION_PHASE)
    {
      throw new IllegalStateException("Request cannot be an ActionRequest");
    }

    PortletRequestDispatcher prd = mPortletContext.getRequestDispatcher(requestURI);

    if (prd == null)
    {
      throw new IllegalArgumentException("No request dispatcher can be created for the specified path: " +
                                         requestURI);
    }

    try
    {
      prd.include((RenderRequest) mOrigPortletRequest, (RenderResponse) mOrigPortletResponse);
    }
    catch (PortletException e)
    {
      if (e.getMessage() != null)
      {
View Full Code Here

      return false;
    }

    try
    {
      PortletRequestDispatcher dispatcher =
        this.getPortletContext().getRequestDispatcher(targetPath);
      dispatcher.forward(request, response);
      return true;
    } catch (Exception e)
    {
      throw new PortletException("Unable to dispatch to: " + targetPath, e);
    }
View Full Code Here

    /**
     *  Prepares the servlet action context for this request
     */
    private void prepareServletActionContext() throws PortletException,
            IOException {
        PortletRequestDispatcher disp = PortletActionContext.getPortletConfig()
                .getPortletContext().getNamedDispatcher("preparator");
        disp.include(PortletActionContext.getRenderRequest(),
                PortletActionContext.getRenderResponse());
    }
View Full Code Here

        res.setContentType(contentType);
        if (StringUtils.isNotEmpty(title)) {
            res.setTitle(title);
        }
        LOG.debug("Location: " + finalLocation);
        PortletRequestDispatcher preparator = cfg.getPortletContext()
                .getNamedDispatcher("preparator");
        if(preparator == null) {
            throw new PortletException("Cannot look up 'preparator' servlet. Make sure that you" +
                "have configured it correctly in the web.xml file.");
        }
        new IncludeTemplate() {
            protected void when(PortletException e) {
                LOG.error("PortletException while dispatching to 'preparator' servlet", e);
            }
            protected void when(IOException e) {
                LOG.error("IOException while dispatching to 'preparator' servlet", e);
            }
        }.include(preparator, req, res);
        PortletRequestDispatcher dispatcher = cfg.getPortletContext().getRequestDispatcher(finalLocation);
        if(dispatcher == null) {
            throw new PortletException("Could not locate dispatcher for '" + finalLocation + "'");
        }
        new IncludeTemplate() {
            protected void when(PortletException e) {
View Full Code Here

        { // dispatch only allowed for RenderRequest
            String msg = "Can not call dispatch() during a portlet ActionRequest";
            throw new UnsupportedOperationException(msg);
        }

        PortletRequestDispatcher requestDispatcher
            = _portletContext.getRequestDispatcher(path); //TODO: figure out why I need named dispatcher
        try
        {
            requestDispatcher.include((RenderRequest) _portletRequest, (RenderResponse) _portletResponse);
        }
        catch (PortletException e)
        {
            if (e.getMessage() != null)
            {
View Full Code Here

    /**
     * 
     */
    private void prepareServletActionContext() throws PortletException,
            IOException {
        PortletRequestDispatcher disp = PortletActionContext.getPortletConfig()
                .getPortletContext().getNamedDispatcher("preparator");
        disp.include(PortletActionContext.getRenderRequest(),
                PortletActionContext.getRenderResponse());
    }
View Full Code Here

TOP

Related Classes of javax.portlet.PortletRequestDispatcher

Copyright © 2018 www.massapicom. 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.