Package org.apache.tapestry.web

Examples of org.apache.tapestry.web.WebContextResource


     */

    protected void addModuleIfExists(RegistryBuilder builder, ClassResolver resolver,
            WebContext context, String path)
    {
        Resource r = new WebContextResource(context, path);

        if (r.getResourceURL() == null)
            return;

        builder.addModuleDescriptorProvider(new XmlModuleDescriptorProvider(resolver, r));
    }
View Full Code Here


    {
        WebContext context = newContext();

        replayControls();

        Resource r = new WebContextResource(context, "/foo/bar/baz_en.html", Locale.ENGLISH);

        assertEquals("context:/foo/bar/baz_en.html", r.toString());

        assertEquals("/foo/bar/baz_en.html", r.getPath());

        assertEquals("baz_en.html", r.getName());

        assertEquals(Locale.ENGLISH, r.getLocale());

        verifyControls();
    }
View Full Code Here

        context.getResource("/foo/bar/baz_en.html");
        control.setReturnValue(new URL("http://foo.com"));

        replayControls();

        Resource r1 = new WebContextResource(context, "/foo/bar/baz.html");

        Resource r2 = r1.getLocalization(Locale.ENGLISH);

        assertEquals("/foo/bar/baz_en.html", r2.getPath());
        assertEquals(Locale.ENGLISH, r2.getLocale());

        verifyControls();
View Full Code Here

        context.getResource("/foo/bar/baz.html");
        control.setReturnValue(new URL("http://foo.com"));

        replayControls();

        Resource r1 = new WebContextResource(context, "/foo/bar/baz.html");

        Resource r2 = r1.getLocalization(Locale.ENGLISH);

        assertSame(r2, r1);

        verifyControls();
    }
View Full Code Here

        context.getResource("/foo/bar/baz.html");
        control.setReturnValue(null);

        replayControls();

        Resource r1 = new WebContextResource(context, "/foo/bar/baz.html");

        assertNull(r1.getLocalization(Locale.ENGLISH));

        verifyControls();
    }
View Full Code Here

    {
        WebContext context = newContext();

        replayControls();

        Resource r1 = new WebContextResource(context, "/foo/bar/baz.html");
        Resource r2 = r1.getRelativeResource("baz.gif");

        assertEquals("/foo/bar/baz.gif", r2.getPath());

        verifyControls();
    }
View Full Code Here

        checkOrder(comp, false);
        WebContext context = newMock(WebContext.class);
        IRequestCycle cycle = newMock(IRequestCycle.class);

        IComponentSpecification spec = new ComponentSpecification();
        WebContextResource base = new WebContextResource(context, "/WEB-INF/MyComponent.jwc");
        spec.setSpecificationLocation(base);
       
        ComponentResourceResolverImpl resolver = new ComponentResourceResolverImpl();

        expect(comp.getSpecification()).andReturn(spec).anyTimes();
View Full Code Here

        checkOrder(comp, false);
        WebContext context = newMock(WebContext.class);
        IRequestCycle cycle = newMock(IRequestCycle.class);

        IComponentSpecification spec = new ComponentSpecification();
        WebContextResource base = new WebContextResource(context, "/WEB-INF/MyComponent.jwc");
        spec.setSpecificationLocation(base);

        ComponentResourceResolverImpl resolver = new ComponentResourceResolverImpl();

        expect(comp.getSpecification()).andReturn(spec).anyTimes();
View Full Code Here

    public Resource getContextRoot()
    {
        WebContext context = (WebContext) getProperty("context");

        return new WebContextResource(context, "/");
    }
View Full Code Here

    public Resource getContextRoot()
    {
        WebContext context = (WebContext) getProperty("context");

        return new WebContextResource(context, "/");
    }
View Full Code Here

TOP

Related Classes of org.apache.tapestry.web.WebContextResource

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.