wicket.markup.html
Class WebResource

java.lang.Object
  extended by wicket.Resource
      extended by wicket.markup.html.WebResource
All Implemented Interfaces:
java.io.Serializable, IRequestListener, IResourceListener
Direct Known Subclasses:
ByteArrayResource, DynamicByteArrayResource, DynamicWebResource, PackageResource

public abstract class WebResource
extends Resource

Base class for web resources. See the base class Resource for details on resources in general, including how they can be shared in an application.

Author:
Jonathan Locke
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface wicket.IResourceListener
INTERFACE
 
Constructor Summary
WebResource()
          Construct.
 
Method Summary
protected  void configureResponse(Response response)
          Allows implementations to do configure the response, like setting headers etc.
protected  void setHeaders(WebResponse response)
          Subclasses can override this to set there headers when the resource is being served.
 
Methods inherited from class wicket.Resource
getParameters, getResourceStream, invalidate, isCacheable, onResourceRequested, setCacheable, setParameters
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebResource

public WebResource()
Construct.

Method Detail

configureResponse

protected final void configureResponse(Response response)
Description copied from class: Resource
Allows implementations to do configure the response, like setting headers etc.

Overrides:
configureResponse in class Resource
Parameters:
response - the respone
See Also:
Resource.configureResponse(wicket.Response)

setHeaders

protected void setHeaders(WebResponse response)
Subclasses can override this to set there headers when the resource is being served. By default 2 headers will be set if the Resource is cacheable
 response.setDateHeader("Expires", System.currentTimeMillis() + (3600 * 1000));
 response.setHeader("Cache-Control", "max-age=" + 3600);
 
So if a resource wants to control this or doesn't want to set this info it should override this method and don't call super.

Parameters:
response - The WebResponse where set(Date)Header can be called on.


Copyright © 2004-2007 Wicket developers. All Rights Reserved.