Examples of PortletRequestDispatcher


Examples of javax.portlet.PortletRequestDispatcher

     * @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

Examples of javax.portlet.PortletRequestDispatcher

            doInclude(path);
            return;
        }

        try {
            PortletRequestDispatcher rd = getPortletContext()
                    .getRequestDispatcher(path);

            if (rd == null) {
                throw new IOException(
                        "No portlet request dispatcher returned for path '"
                                + path + "'");
            }

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

Examples of javax.portlet.PortletRequestDispatcher

    }

    /** {@inheritDoc} */
    public void doInclude(String path) throws IOException {
        try {
            PortletRequestDispatcher rd = getPortletContext()
                    .getRequestDispatcher(path);

            if (rd == null) {
                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

Examples of javax.portlet.PortletRequestDispatcher

*
*/
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

Examples of javax.portlet.PortletRequestDispatcher

                    + view);
        }

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

    }
View Full Code Here

Examples of javax.portlet.PortletRequestDispatcher

public class JSPHelloUserPortlet extends GenericPortlet {

    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

Examples of javax.portlet.PortletRequestDispatcher

        }
    }

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

Examples of javax.portlet.PortletRequestDispatcher

        prd.include(rRequest, rResponse);
    }

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

Examples of javax.portlet.PortletRequestDispatcher

        navigationRootNodeBean.setChildren(rootNodeChildrenList);

        request.setAttribute("showEmptyCategory", showEmptyCategory);
        request.setAttribute("navigationRootNode", navigationRootNodeBean);

        PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/navigation.jsp");
        prd.include(request, response);
    }
View Full Code Here

Examples of javax.portlet.PortletRequestDispatcher

        chosenNodeBean.setChildren(nodeChildrenList);

        request.setAttribute("showEmptyCategory", showEmptyCategory);
        request.setAttribute("parentNode", chosenNodeBean);

        PortletRequestDispatcher prd = getPortletContext().getRequestDispatcher("/jsp/node.jsp");
        prd.include(request, response);
    }
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.