|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.Resource org.apache.wicket.markup.html.WebResource
public abstract class WebResource
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.
Field Summary |
---|
Fields inherited from interface org.apache.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 int |
getCacheDuration()
default implementation is to cache resources for 1 hour. |
protected void |
setHeaders(WebResponse response)
Subclasses can override this to set there headers when the resource is being served. |
Methods inherited from class org.apache.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 |
---|
public WebResource()
Method Detail |
---|
protected final void configureResponse(Response response)
Resource
configureResponse
in class Resource
response
- the responseResource.configureResponse(org.apache.wicket.Response)
protected void setHeaders(WebResponse response)
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.
response
- The WebResponse where set(Date)Header can be called on.protected int getCacheDuration()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |