mitreid-connect
静的公開変数類 | 限定公開メンバ関数 | 非公開変数類 | 静的非公開変数類 | 全メンバ一覧
org.mitre.openid.connect.view.JsonErrorView クラス
org.mitre.openid.connect.view.JsonErrorView の継承関係図
Inheritance graph
org.mitre.openid.connect.view.JsonErrorView 連携図
Collaboration graph

静的公開変数類

static final String ERROR_MESSAGE = "errorMessage"
 
static final String ERROR = "error"
 
static final String VIEWNAME = "jsonErrorView"
 

限定公開メンバ関数

void renderMergedOutputModel (Map< String, Object > model, HttpServletRequest request, HttpServletResponse response)
 

非公開変数類

Gson gson
 

静的非公開変数類

static final Logger logger = LoggerFactory.getLogger(JsonErrorView.class)
 

詳解

著者
aanganes, jricher

関数詳解

◆ renderMergedOutputModel()

void org.mitre.openid.connect.view.JsonErrorView.renderMergedOutputModel ( Map< String, Object >  model,
HttpServletRequest  request,
HttpServletResponse  response 
)
inlineprotected
90  {
91 
92  response.setContentType(MediaType.APPLICATION_JSON_VALUE);
93 
94 
95  HttpStatus code = (HttpStatus) model.get(HttpCodeView.CODE);
96  if (code == null) {
97  code = HttpStatus.INTERNAL_SERVER_ERROR; // default to 500
98  }
99 
100  response.setStatus(code.value());
101 
102  try {
103 
104  Writer out = response.getWriter();
105 
106  String errorTitle = (String) model.get(ERROR);
107  if (Strings.isNullOrEmpty(errorTitle)) {
108  errorTitle = "mitreid_error";
109  }
110  String errorMessage = (String) model.get(ERROR_MESSAGE);
111  JsonObject obj = new JsonObject();
112  obj.addProperty("error", errorTitle);
113  obj.addProperty("error_description", errorMessage);
114  gson.toJson(obj, out);
115 
116  } catch (IOException e) {
117 
118  logger.error("IOException in JsonErrorView.java: ", e);
119 
120  }
121  }
Gson gson
Definition: JsonErrorView.java:66
static final String ERROR_MESSAGE
Definition: JsonErrorView.java:52
static final Logger logger
Definition: JsonErrorView.java:62
static final String ERROR
Definition: JsonErrorView.java:57

メンバ詳解

◆ ERROR

final String org.mitre.openid.connect.view.JsonErrorView.ERROR = "error"
static

◆ ERROR_MESSAGE

final String org.mitre.openid.connect.view.JsonErrorView.ERROR_MESSAGE = "errorMessage"
static

◆ gson

Gson org.mitre.openid.connect.view.JsonErrorView.gson
private
初期値:
= new GsonBuilder()
.setExclusionStrategies(new ExclusionStrategy() {
@Override
public boolean shouldSkipField(FieldAttributes f) {
return false;
}
@Override
public boolean shouldSkipClass(Class<?> clazz) {
if (clazz.equals(BeanPropertyBindingResult.class)) {
return true;
}
return false;
}
})
.serializeNulls()
.setDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")
.create()

◆ logger

final Logger org.mitre.openid.connect.view.JsonErrorView.logger = LoggerFactory.getLogger(JsonErrorView.class)
staticprivate

Logger for this class

◆ VIEWNAME

final String org.mitre.openid.connect.view.JsonErrorView.VIEWNAME = "jsonErrorView"
static

このクラス詳解は次のファイルから抽出されました: