public class HttpStatusView extends AbstractView
Modifier and Type | Field and Description |
---|---|
static HttpStatusView |
BAD_REQUEST
STATUS: 400
|
static HttpStatusView |
METHOD_NOT_ALLOWED
STATUS: 405
|
static HttpStatusView |
NOT_FOUND
STATUS: 404
|
attributes, baseViewPath, contentType, response
DEFAULT_CHARSET
Constructor and Description |
---|
HttpStatusView(int status)
构造器
|
HttpStatusView(int status,
boolean useError)
构造器
|
HttpStatusView(int status,
String msg)
构造器
|
Modifier and Type | Method and Description |
---|---|
static HttpStatusView |
bind(int status) |
static HttpStatusView |
bind(int status,
String msg) |
protected void |
doRenderView()
视图渲染具体操作
|
HttpStatusView |
writeBody(String bodyStr)
将文本内容写入回应数据流(注:调用此方法需采用useError=false设置)
|
addAttribute, addAttributes, addDateHeader, addHeader, addIntHeader, buildUrl, doProcessPath, doViewInit, getAttribute, getAttributes, getBaseViewPath, getContentType, render, render, setContentType
public static HttpStatusView METHOD_NOT_ALLOWED
public static HttpStatusView NOT_FOUND
public static HttpStatusView BAD_REQUEST
public HttpStatusView(int status)
status
- HTTP返回码public HttpStatusView(int status, boolean useError)
status
- HTTP返回码useError
- 是否使用sendError方法public HttpStatusView(int status, String msg)
status
- HTTP返回码msg
- 错误提示信息public static HttpStatusView bind(int status)
public static HttpStatusView bind(int status, String msg)
public HttpStatusView writeBody(String bodyStr)
bodyStr
- 写入的内容protected void doRenderView() throws Exception
AbstractView
doRenderView
in class AbstractView
Exception
- 抛出任何可能异常Copyright © 2022. All rights reserved.