本文整理汇总了Java中org.apache.wicket.request.http.WebResponse.setHeader方法的典型用法代码示例。如果您正苦于以下问题:Java WebResponse.setHeader方法的具体用法?Java WebResponse.setHeader怎么用?Java WebResponse.setHeader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.request.http.WebResponse
的用法示例。
在下文中一共展示了WebResponse.setHeader方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: respond
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
/** {@inheritDoc} */
public void respond(final IRequestCycle requestCycle)
{
String location = requestCycle.getUrlRenderer().renderRelativeUrl(Url.parse(getRedirectUrl()));
WebResponse response = (WebResponse)requestCycle.getResponse();
if (status == HttpServletResponse.SC_MOVED_TEMPORARILY)
{
response.sendRedirect(location);
}
else
{
response.setStatus(status);
response.setHeader("Location", location);
}
}
示例2: onClick
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
public void onClick() {
IResourceStream resourceStream = getResourceStream();
RequestCycle requestCycle = getRequestCycle();
WebResponse response = (WebResponse) requestCycle.getResponse();
response.setHeader("Cache-Control", "no-store");
requestCycle.scheduleRequestHandlerAfterCurrent(
new ResourceStreamRequestHandler(resourceStream)
.setFileName(getFileName())
.setContentDisposition(ContentDisposition.ATTACHMENT));
}
示例3: configureResponse
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void configureResponse(WebResponse response) {
super.configureResponse(response);
response.setHeader("Cache-Control", "no-cache, max-age=0, must-revalidate, no-store");
//for IE
response.setHeader("Expires", "-1");
response.setHeader("Pragma", "no-cache");
}
示例4: configureResponse
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void configureResponse(WebResponse response) {
super.configureResponse(response);
response.setHeader("Cache-Control", "no-store");
}