Package javax.portlet

Examples of javax.portlet.PortletRequestDispatcher


          .append("&").append(KEY_B).append("=").append(VALUE_B)
          .append("&").append(KEY_C).append("=");
      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


        if (testConfig != null) {
          displayUri = testConfig.getDisplayURI();
        } else {
          displayUri = "/jsp/introduction.jsp";
        }
        PortletRequestDispatcher dispatcher = getPortletContext()
            .getRequestDispatcher(displayUri);
        dispatcher.include(request, response);
    }
View Full Code Here

     * @param request  the portlet request.
     * @param response  the portlet response.
     */
    protected void doEdit(RenderRequest request, RenderResponse response)
    throws PortletException, IOException {
        PortletRequestDispatcher dispatcher = getPortletContext()
            .getRequestDispatcher("/jsp/edit.jsp");
        dispatcher.include(request, response);
    }
View Full Code Here

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

        if (index > 0 && index < path.length() - 1) {
          queryString = path.substring(index + 1);
        }
       
        // Construct PortletRequestDispatcher.
        PortletRequestDispatcher portletRequestDispatcher = null;
        try {
            RequestDispatcher servletRequestDispatcher = servletContext
                .getRequestDispatcher(path);
            if (servletRequestDispatcher != null) {
              portletRequestDispatcher = new PortletRequestDispatcherImpl(
View Full Code Here

     * @throws IOException If something goes wrong.
     * @throws PortletException If something goes wrong.
     */
    @Test
    public void testDoForward() throws PortletException, IOException {
        PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);

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

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

     * @throws IOException If something goes wrong.
     * @throws PortletException If something goes wrong.
     */
    @Test(expected = IOException.class)
    public void testDoForwardPortletException() throws PortletException, IOException {
        PortletRequestDispatcher rd = createMock(PortletRequestDispatcher.class);

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

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

     * @throws IOException If something goes wrong.
     * @throws PortletException If something goes wrong.
     */
    @Test
    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

     * @throws IOException If something goes wrong.
     * @throws PortletException If something goes wrong.
     */
    @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

     * @throws IOException If something goes wrong.
     * @throws PortletException If something goes wrong.
     */
    @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

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.