本文整理汇总了Java中org.apache.wicket.request.http.WebResponse.setStatus方法的典型用法代码示例。如果您正苦于以下问题:Java WebResponse.setStatus方法的具体用法?Java WebResponse.setStatus怎么用?Java WebResponse.setStatus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.wicket.request.http.WebResponse
的用法示例。
在下文中一共展示了WebResponse.setStatus方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: toObject
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
/**
* Utility method to convert string values to the corresponding objects.
*
* @param clazz
* the type of the object we want to obtain.
* @param value
* the string value we want to convert.
* @return the object corresponding to the converted string value, or null
* if value parameter is null
*/
public static Object toObject(Class clazz, String value) throws IllegalArgumentException {
if (value == null)
return null;
// we use the standard Wicket conversion mechanism to obtain the
// converted value.
try {
IConverter converter = Application.get().getConverterLocator().getConverter(clazz);
return converter.convertToObject(value, Session.get().getLocale());
} catch (Exception e) {
WebResponse response = (WebResponse) RequestCycle.get().getResponse();
response.setStatus(400);
response.write("Could not find a suitable constructor for value '" + value
+ "' of type '" + clazz + "'");
return null;
}
}
示例3: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response) {
final HttpServletRequest request = RequestCycles.getContainerRequest();
final Integer statusCode = (Integer) request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
if (statusCode != null) {
response.setStatus(statusCode);
} else {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
示例4: newStringResponse
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
private WebResponse newStringResponse() {
WebResponse response = (WebResponse) getResponse();
response.setContentType("text/plain");
response.write(responseText());
response.flush();
response.setStatus(HttpStatus.OK.value());
return response;
}
示例5: configureResponse
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void configureResponse(WebResponse response) {
super.configureResponse(response);
response.setStatus(getCode());
}
示例6: configureResponse
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void configureResponse(WebResponse response) {
super.configureResponse(response);
response.setStatus(errorType.code());
}
示例7: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response) {
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
}
示例8: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response)
{
response.setStatus(HttpServletResponse.SC_FORBIDDEN);
}
示例9: configureResponse
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void configureResponse(WebResponse response) {
super.configureResponse(response);
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
示例10: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response) {
response.setStatus(HttpServletResponse.SC_GONE);
}
示例11: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response) {
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
示例12: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response)
{
response.setStatus(HttpServletResponse.SC_GONE);
}
示例13: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
示例14: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response) {
response.setStatus(INTERNAL_SERVER_ERROR);
}
示例15: setHeaders
import org.apache.wicket.request.http.WebResponse; //导入方法依赖的package包/类
@Override
protected void setHeaders(final WebResponse response) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}