Package org.apache.wicket.request.handler.resource

Examples of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler


    Request request = getRequest(Url.parse(encrypted));

    IRequestHandler requestHandler = mapper.mapRequest(request);

    assertTrue(requestHandler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler handler = (ResourceReferenceRequestHandler)requestHandler;

    assertEquals(getClass(), handler.getResourceReference().getScope());
    assertEquals("less-crypt.txt", handler.getResourceReference().getName());
  }
View Full Code Here


   *            The components markupid.
   * @return The component to show while the real component is being created.
   */
  public Component getLoadingComponent(final String markupId)
  {
    IRequestHandler handler = new ResourceReferenceRequestHandler(
      AbstractDefaultAjaxBehavior.INDICATOR);
    return new Label(markupId, "<img alt=\"Loading...\" src=\"" +
      RequestCycle.get().urlFor(handler) + "\"/>").setEscapeModelStrings(false);
  }
View Full Code Here

  public void decode1()
  {
    Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference1");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertTrue(handler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler)handler;
    assertEquals(resource1, h.getResource());
    assertEquals(0, h.getPageParameters().getIndexedCount());
    assertEquals(0, h.getPageParameters().getNamedKeys().size());
  }
View Full Code Here

  public void decode1A()
  {
    Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference1?en");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertTrue(handler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler)handler;
    assertEquals(resource1, h.getResource());
    assertEquals(Locale.ENGLISH, h.getLocale());
    assertEquals(null, h.getStyle());
    assertEquals(null, h.getVariation());
    assertEquals(0, h.getPageParameters().getIndexedCount());
    assertEquals(0, h.getPageParameters().getNamedKeys().size());
  }
View Full Code Here

  public void decode2()
  {
    Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference1?p1=v1&p2=v2");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertTrue(handler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler)handler;
    assertEquals(resource1, h.getResource());
    assertEquals(null, h.getLocale());
    assertEquals(null, h.getStyle());
    assertEquals(null, h.getVariation());
    assertEquals(0, h.getPageParameters().getIndexedCount());
    assertEquals("v1", h.getPageParameters().get("p1").toString());
    assertEquals("v2", h.getPageParameters().get("p2").toString());
  }
View Full Code Here

  public void decode2A()
  {
    Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference1?-style&p1=v1&p2=v2");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertTrue(handler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler)handler;
    assertEquals(resource1, h.getResource());
    assertEquals(null, h.getLocale());
    assertEquals("style", h.getStyle());
    assertEquals(null, h.getVariation());
    assertEquals(0, h.getPageParameters().getIndexedCount());
    assertEquals("v1", h.getPageParameters().get("p1").toString());
    assertEquals("v2", h.getPageParameters().get("p2").toString());
  }
View Full Code Here

  public void decode3()
  {
    Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference2/name2?en_EN");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertTrue(handler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler)handler;
    assertEquals(resource2, h.getResource());
    assertEquals(new Locale("en", "en"), h.getLocale());
    assertEquals(null, h.getStyle());
    assertEquals(null, h.getVariation());
    assertEquals(0, h.getPageParameters().getIndexedCount());
    assertEquals(0, h.getPageParameters().getNamedKeys().size());
  }
View Full Code Here

  public void decode3A()
  {
    Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference2/name2?en_EN-style");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertTrue(handler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler)handler;
    assertEquals(resource2, h.getResource());
    assertEquals(new Locale("en", "en"), h.getLocale());
    assertEquals("style", h.getStyle());
    assertEquals(null, h.getVariation());
    assertEquals(0, h.getPageParameters().getIndexedCount());
    assertEquals(0, h.getPageParameters().getNamedKeys().size());
  }
View Full Code Here

  public void decode4()
  {
    Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference2/name2?en_EN&p1=v1&p2=v2");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertTrue(handler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler)handler;
    assertEquals(resource2, h.getResource());
    assertEquals(new Locale("en", "en"), h.getLocale());
    assertEquals(null, h.getStyle());
    assertEquals(null, h.getVariation());
    assertEquals("v1", h.getPageParameters().get("p1").toString());
    assertEquals("v2", h.getPageParameters().get("p2").toString());
  }
View Full Code Here

  public void decode5()
  {
    Url url = Url.parse("wicket/resource/" + CLASS_NAME + "/reference3?-style");
    IRequestHandler handler = encoder.mapRequest(getRequest(url));
    assertTrue(handler instanceof ResourceReferenceRequestHandler);
    ResourceReferenceRequestHandler h = (ResourceReferenceRequestHandler)handler;
    assertEquals(resource3, h.getResource());
    assertEquals(null, h.getLocale());
    assertEquals("style", h.getStyle());
    assertEquals(null, h.getVariation());
    assertEquals(0, h.getPageParameters().getIndexedCount());
    assertEquals(0, h.getPageParameters().getNamedKeys().size());
  }
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.handler.resource.ResourceReferenceRequestHandler

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.