parent
9ee6303876
commit
a85e27c7cd
|
@ -180,19 +180,21 @@ public final class WebMvcTags {
|
||||||
*/
|
*/
|
||||||
public static Tag outcome(HttpServletResponse response) {
|
public static Tag outcome(HttpServletResponse response) {
|
||||||
if (response != null) {
|
if (response != null) {
|
||||||
int status = response.getStatus();
|
HttpStatus status = extractStatus(response);
|
||||||
if (status < 200) {
|
if (status != null) {
|
||||||
|
if (status.is1xxInformational()) {
|
||||||
return OUTCOME_INFORMATIONAL;
|
return OUTCOME_INFORMATIONAL;
|
||||||
}
|
}
|
||||||
if (status < 300) {
|
if (status.is2xxSuccessful()) {
|
||||||
return OUTCOME_SUCCESS;
|
return OUTCOME_SUCCESS;
|
||||||
}
|
}
|
||||||
if (status < 400) {
|
if (status.is3xxRedirection()) {
|
||||||
return OUTCOME_REDIRECTION;
|
return OUTCOME_REDIRECTION;
|
||||||
}
|
}
|
||||||
if (status < 500) {
|
if (status.is4xxClientError()) {
|
||||||
return OUTCOME_CLIENT_ERROR;
|
return OUTCOME_CLIENT_ERROR;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return OUTCOME_SERVER_ERROR;
|
return OUTCOME_SERVER_ERROR;
|
||||||
}
|
}
|
||||||
return OUTCOME_UNKNOWN;
|
return OUTCOME_UNKNOWN;
|
||||||
|
|
Loading…
Reference in New Issue