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

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


   */
  @Test
  public void urlForStaticResource() throws Exception
  {
    IStaticCacheableResource resource = mock(IStaticCacheableResource.class);
    ResourceRequestHandler handler = new ResourceRequestHandler(resource, new PageParameters());
    CharSequence url = requestCycle.urlFor(handler);
    assertEquals('.'+RESOURCE_URL, url);
  }
View Full Code Here


   */
  @Test
  public void urlForDynamicResource() throws Exception
  {
    ByteArrayResource resource = new ByteArrayResource(null, new byte[] {1, 2}, "test.bin");
    ResourceRequestHandler handler = new ResourceRequestHandler(resource, new PageParameters());
    CharSequence url = requestCycle.urlFor(handler);
    assertEquals('.'+RESOURCE_URL + JSESSIONID, url);
  }
View Full Code Here

          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
      else if (handler instanceof ResourceRequestHandler)
      {
        ResourceRequestHandler rrh = (ResourceRequestHandler) handler;
        IResource resource = rrh.getResource();
        if (resource instanceof IStaticCacheableResource == false)
        {
          renderedUrl = getOriginalResponse().encodeURL(renderedUrl);
        }
      }
View Full Code Here

   */
  @Test
  public void urlForStaticResource() throws Exception
  {
    IStaticCacheableResource resource = mock(IStaticCacheableResource.class);
    ResourceRequestHandler handler = new ResourceRequestHandler(resource, new PageParameters());
    CharSequence url = requestCycle.urlFor(handler);
    assertEquals(RESOURCE_URL, url);
  }
View Full Code Here

   */
  @Test
  public void urlForDynamicResource() throws Exception
  {
    ByteArrayResource resource = new ByteArrayResource(null, new byte[] {1, 2}, "test.bin");
    ResourceRequestHandler handler = new ResourceRequestHandler(resource, new PageParameters());
    CharSequence url = requestCycle.urlFor(handler);
    assertEquals(RESOURCE_URL + JSESSIONID, url);
  }
View Full Code Here

            // Yes, calling RequestCycle#setRequest() is frowned upon so this is a bit of a hack.
            ((RequestCycle)requestCycle).setRequest(new MergedRequest(origRequest));
       
            for(ResourceReference ref : this.resources)
            {
                ResourceRequestHandler handler = new ResourceRequestHandler(
                    ref.getResource(),
                    this.pageParameters);
                handler.respond(requestCycle);
           
                // If first resource sent 304 Not Modified that means all will.
                // We can therefore skip the rest.
                if(304 == merged.status)
                {
View Full Code Here

    PageParameters pageParams = null;
    final Page page = findPage();
    if (page != null)
      pageParams = page.getPageParameters();

    ResourceRequestHandler reqh = new ResourceRequestHandler(resource,
        pageParams);

    reqh.respond(getRequestCycle());
  }
View Full Code Here

    PageParameters pageParams = null;
    final Page page = findPage();
    if (page != null)
      pageParams = page.getPageParameters();

    ResourceRequestHandler reqh = new ResourceRequestHandler(resource, pageParams);

    reqh.respond(getRequestCycle());
  }
View Full Code Here

TOP

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

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.