APISonar


com.blade.mvc.http.Response.json

> com > blade > mvc > http > Response > json
com APIs blade APIs mvc APIs http APIs Response APIs json APIs

Example 1
protected void handleValidators(ValidatorException validatorException, Request request, Response response) {
        var code = Optional.ofNullable(validatorException.getCode()).orElse(500);
        if (request.isAjax() || request.contentType().toLowerCase().contains("json")) {
            response.json(RestResponse.fail(code, validatorException.getMessage()));
        } else {
            this.handleException(validatorException, request, response);
        }
    }