Package org.apache.tapestry

Examples of org.apache.tapestry.IExternalPage


    public void service(IRequestCycle cycle) throws IOException
    {
        String pageName = cycle.getParameter(ServiceConstants.PAGE);
        IPage rawPage = cycle.getPage(pageName);

        IExternalPage page = null;

        try
        {
            page = (IExternalPage) rawPage;
        }
        catch (ClassCastException ex)
        {
            throw new ApplicationRuntimeException(EngineMessages.pageNotCompatible(
                    rawPage,
                    IExternalPage.class), rawPage, null, ex);
        }

        Object[] parameters = _linkFactory.extractListenerParameters(cycle);

        cycle.setListenerParameters(parameters);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        _responseRenderer.renderResponse(cycle);
    }
View Full Code Here


    }

    private IExternalPage newExternalPage(String pageName)
    {
        MockControl control = newControl(IExternalPage.class);
        IExternalPage page = (IExternalPage) control.getMock();

        page.getPageName();
        control.setReturnValue(pageName);

        return page;
    }
View Full Code Here

    public void testByName()
    {
        Object[] parameters =
        { "param1", "param2" };

        IExternalPage page = newExternalPage();
        IRequestCycle cycle = newCycleGetPage("Fred", page);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        replayControls();

        ExternalCallback callback = new ExternalCallback("Fred", parameters);
View Full Code Here

        verifyControls();
    }

    public void testByNameNoParameters()
    {
        IExternalPage page = newExternalPage();
        IRequestCycle cycle = newCycleGetPage("Fred", page);

        cycle.activate(page);

        page.activateExternalPage(null, cycle);

        replayControls();

        ExternalCallback callback = new ExternalCallback("Fred", null);
View Full Code Here

    public void testByPage()
    {
        Object[] parameters =
        { "param1", "param2" };

        IExternalPage page = newExternalPage("Barney");
        IRequestCycle cycle = newCycleGetPage("Barney", page);

        cycle.activate(page);

        page.activateExternalPage(parameters, cycle);

        replayControls();

        ExternalCallback callback = new ExternalCallback(page, parameters);
View Full Code Here

TOP

Related Classes of org.apache.tapestry.IExternalPage

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.