public class ErrorRender extends Render
| 限定符和类型 | 字段和说明 |
|---|---|
protected static String |
contentTypeHtml |
protected static String |
contentTypeJson |
protected int |
errorCode |
protected static Map<Integer,byte[]> |
errorHtmlMap |
protected static Map<Integer,byte[]> |
errorJsonMap |
protected static Map<Integer,String> |
errorViewMap |
protected static byte[] |
html400 |
protected static byte[] |
html401 |
protected static byte[] |
html403 |
protected static byte[] |
html404 |
protected static byte[] |
html500 |
protected static byte[] |
json400 |
protected static byte[] |
json401 |
protected static byte[] |
json403 |
protected static byte[] |
json404 |
protected static byte[] |
json500 |
protected static String |
version |
protected String |
viewOrJson |
| 构造器和说明 |
|---|
ErrorRender(int errorCode) |
ErrorRender(int errorCode,
String viewOrJson) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
getErrorCode() |
byte[] |
getErrorHtml() |
byte[] |
getErrorJson() |
static String |
getErrorView(int errorCode) |
void |
render()
Render to client
|
static void |
setErrorHtmlContent(int errorCode,
String htmlContent)
设置异常发生时响应的 html 内容
|
static void |
setErrorJsonContent(int errorCode,
String jsonContent)
设置异常发生时响应的 json 内容
|
static void |
setErrorView(int errorCode,
String errorView)
设置异常发生时响应的错误页面
|
close, getDevMode, getEncoding, getView, setContext, setContext, setViewprotected static final String contentTypeHtml
protected static final String contentTypeJson
protected static final byte[] html404
protected static final byte[] html500
protected static final byte[] html400
protected static final byte[] html401
protected static final byte[] html403
protected static final byte[] json404
protected static final byte[] json500
protected static final byte[] json400
protected static final byte[] json401
protected static final byte[] json403
protected int errorCode
protected String viewOrJson
public ErrorRender(int errorCode,
String viewOrJson)
public ErrorRender(int errorCode)
public static void setErrorView(int errorCode,
String errorView)
public static String getErrorView(int errorCode)
public static void setErrorHtmlContent(int errorCode,
String htmlContent)
public static void setErrorJsonContent(int errorCode,
String jsonContent)
public byte[] getErrorHtml()
public byte[] getErrorJson()
public int getErrorCode()
Copyright © 2024. All rights reserved.