org.apache.wicket.markup.html
Class WebResource
java.lang.Object
org.apache.wicket.Resource
org.apache.wicket.markup.html.WebResource
- All Implemented Interfaces:
- Serializable, IClusterable, IRequestListener, IResourceListener
- Direct Known Subclasses:
- ByteArrayResource, ContextRelativeResource, 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
Method Summary |
protected void |
configureResponse(Response response)
Allows implementations to do configure the response, like setting headers etc. |
protected int |
getCacheDuration()
|
protected void |
setHeaders(WebResponse response)
Subclasses can override this to set there headers when the resource is being served. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WebResource
public WebResource()
- Construct.
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 response- See Also:
Resource.configureResponse(org.apache.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.
getCacheDuration
protected int getCacheDuration()
- Returns:
- The cache duration in seconds
Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.