List of usage examples for org.apache.wicket.request.http WebResponse addHeader
public abstract void addHeader(String name, String value);
From source file:com.gitblit.wicket.pages.BasePage.java
License:Apache License
/** * Sets the last-modified header field and the expires field. * * @param when/* w w w. ja v a 2 s. com*/ */ protected final void setLastModified(Date when) { if (when == null) { return; } if (when.before(app().getBootDate())) { // last-modified can not be before the Gitblit boot date // this helps ensure that pages are properly refreshed after a // server config change when = app().getBootDate(); } int expires = app().settings().getInteger(Keys.web.pageCacheExpires, 0); WebResponse response = (WebResponse) getResponse(); response.setLastModifiedTime(Time.valueOf(when)); response.addHeader("Expires", String.valueOf(System.currentTimeMillis() + Duration.minutes(expires).getMilliseconds())); }
From source file:net.micwin.openspace.view.BasePageView.java
License:Open Source License
@Override protected void setHeaders(WebResponse response) { super.setHeaders(response); response.addHeader("refresh", "30"); }