Package javax.portlet

Examples of javax.portlet.PortletRequestDispatcher.include()


      if (LOG.isDebugEnabled()) {
        LOG.debug("Dispatching to: " + buffer.toString());
      }
      PortletRequestDispatcher dispatcher = context.getRequestDispatcher(
          buffer.toString());
      dispatcher.include((RenderRequest) request, (RenderResponse) response);
     
      // Retrieve test result returned by the companion servlet.
        TestResult result = (TestResult) request.getAttribute(RESULT_KEY);
      request.removeAttribute(RESULT_KEY);
      return result;
View Full Code Here


        } else {
          displayUri = "/jsp/introduction.jsp";
        }
        PortletRequestDispatcher dispatcher = getPortletContext()
            .getRequestDispatcher(displayUri);
        dispatcher.include(request, response);
    }

    /**
     * Serves up the <code>edit</code> mode. This method dispatches the request
     * and response to the edit JSP page (<code>/jsp/edit.jsp</code>).
View Full Code Here

     */
    protected void doEdit(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
        PortletRequestDispatcher dispatcher = getPortletContext()
            .getRequestDispatcher("/jsp/edit.jsp");
        dispatcher.include(request, response);
    }
   
    /**
     * Serves up the <code>help</code> mode. This method dispatches the request
     * and response to the help JSP page (<code>/jsp/help.jsp</code>).
View Full Code Here

     */
    protected void doHelp(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
      PortletRequestDispatcher dispatcher = getPortletContext()
          .getRequestDispatcher("/jsp/help.jsp");
      dispatcher.include(request, response);
    }
   
   
    // Private Methods ---------------------------------------------------------
   
View Full Code Here

    public void testDoForwardInclude() throws PortletException, IOException {
        PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);

        expect(responseDelegate.isResponseCommitted()).andReturn(true);
        expect(portletContext.getRequestDispatcher("/my/path")).andReturn(rd);
        rd.include(request, response);

        replay(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
        req.doForward("/my/path");
        verify(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
    }
View Full Code Here

    @Test
    public void testDoInclude() throws IOException, PortletException {
        PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);

        expect(portletContext.getRequestDispatcher("/my/path")).andReturn(rd);
        rd.include(request, response);

        replay(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
        req.doInclude("/my/path");
        verify(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
    }
View Full Code Here

    @Test(expected = IOException.class)
    public void testDoIncludePortletException() throws IOException, PortletException {
        PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);

        expect(portletContext.getRequestDispatcher("/my/path")).andReturn(rd);
        rd.include(request, response);
        expectLastCall().andThrow(new PortletException());

        replay(applicationContext, request, response, rd, portletContext, requestDelegate, responseDelegate);
        try {
            req.doInclude("/my/path");
View Full Code Here

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

            rd.include(request, response);
        } catch (PortletException e) {
            throw new IOException("PortletException while including path '"
                    + path + "'.", e);
        }
    }
View Full Code Here

*/
public class TodoPortlet extends GenericPortlet {
    @Override
    public void render(RenderRequest request, RenderResponse response) throws PortletException, IOException {
        PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/todos/todo.html");
        prd.include(request, response);
    }
}
View Full Code Here

        String include = renderer.render(renderRequest, renderResponse);
        if (include != null) {
            PortletRequestDispatcher requestDispatcher = context
                    .getRequestDispatcher(include);
            requestDispatcher.include(renderRequest, renderResponse);
        }

    }

    public void processAction(ActionRequest actionRequest,
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.