Package org.apache.wicket.request.resource

Examples of org.apache.wicket.request.resource.IResource$Attributes


   * @throws Exception
   */
  @Test
  public void urlForResourceReferenceWithNonStaticResource() throws Exception
  {
    final IResource resource = mock(IResource.class);
    ResourceReference reference = new ResourceReference("dummy")
    {
      @Override
      public IResource getResource()
      {
View Full Code Here


   
    protected String applyCachingStrategy(String fileName, PageParameters parameters)
    {
        ResourceUrl resourceUrl = new ResourceUrl(fileName, parameters);
        ResourceReference lastMod = getLastModifiedReference();
        IResource res = lastMod.getResource();
        if(res instanceof IStaticCacheableResource)
        {
            this.cachingStrategy.get().decorateUrl(resourceUrl, (IStaticCacheableResource) res);
        }
        return resourceUrl.getFileName();
View Full Code Here

     * De-reference the resource and open its stream to determine the last modified time.
     */
    protected Time getLastModifiedTime(ResourceReference ref)
    {
        Time modified = null;
        IResource res = ref.getResource();
        if(res instanceof IStaticCacheableResource)
        {
            IResourceStream stream = ((IStaticCacheableResource) res).getCacheableResourceStream();
            modified = stream.lastModifiedTime();
        }
View Full Code Here

   * Receives ajax events and delegates them to the page which where rendered previously.
   */
  @Override
  public IResource getResource()
  {
    return new IResource()
    {
      private static final long serialVersionUID = 3070290312369930992L;

      @Override
      public void respond(Attributes attributes)
View Full Code Here

    else if (requestHandler instanceof SharedResourceReference) {
      url = encodeSharedResourceUrl(url);
    }
    else if (requestHandler instanceof ResourceReferenceRequestHandler) {
      ResourceReferenceRequestHandler resourceReferenceRequestHandler = (ResourceReferenceRequestHandler) requestHandler;
      IResource resource = resourceReferenceRequestHandler.getResource();

      if (resource instanceof PackageResource) {
        url = encodeSharedResourceUrl(url);
      }
      else {
View Full Code Here

    {
      return;
    }

    String path = mountAnnotation.value();
    final IResource resourceInstance = (IResource) clazz.newInstance();

    application.mountResource(path, new ResourceReference(clazz.getSimpleName())
    {
      /**
            *
 
View Full Code Here

        String token = tokens.nextToken();

        // on the last component of the resource path
        if (tokens.hasMoreTokens() == false && Strings.isEmpty(token) == false)
        {
          final IResource resource = reference.getResource();

          // apply caching if required
          if (resource instanceof IStaticCacheableResource)
          {
            // add caching related information to filename + query parameters
View Full Code Here

    final String filename = segments.get(lastSegmentAt);

    if (Strings.isEmpty(filename) == false)
    {
      // TODO is calling getResource() a potential performance bottleneck?
      final IResource resource = resourceReference.getResource();

      if (resource instanceof IStaticCacheableResource)
      {
        final IStaticCacheableResource cacheable = (IStaticCacheableResource)resource;
        final ResourceUrl cacheUrl = new ResourceUrl(filename, parameters);
View Full Code Here

      application = new MockApplication();
      WicketFilter filter = new WicketFilter();
      filter.init(new FilterTestingConfig());
      ThreadContext.setApplication(application);
      final String failure = "Should never get here when an OPTIONS request is issued";
      IResource resource = new AbstractResource()
      {
        @Override
        protected ResourceResponse newResourceResponse(Attributes attributes)
        {
View Full Code Here

TOP

Related Classes of org.apache.wicket.request.resource.IResource$Attributes

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.