public class ExceptionTranslator
extends java.lang.Object
| 构造器和说明 |
|---|
ExceptionTranslator(org.springframework.context.MessageSource messageSource) |
| 限定符和类型 | 方法和说明 |
|---|---|
protected java.lang.String |
getMessage(java.lang.String msgKey,
java.util.Locale locale,
java.lang.Object[] values) |
protected java.lang.String |
getMessage(java.lang.Throwable e,
java.util.Locale locale,
java.lang.Object[] values) |
java.lang.String |
handle(java.lang.Throwable error)
异常处理
1.
|
protected java.lang.String |
handleError(org.springframework.validation.BindException e) |
protected java.lang.String |
handleError(javax.validation.ConstraintViolationException e) |
protected java.lang.String |
handleError(org.springframework.web.HttpMediaTypeNotSupportedException e,
java.util.Locale locale) |
protected java.lang.String |
handleError(org.springframework.web.HttpRequestMethodNotSupportedException e,
java.util.Locale locale) |
protected java.lang.String |
handleError(LocalizedException e,
java.util.Locale locale) |
protected java.lang.String |
handleError(org.springframework.web.bind.MethodArgumentNotValidException e) |
protected java.lang.String |
handleError(org.springframework.web.bind.MissingServletRequestParameterException e,
java.util.Locale locale) |
protected java.lang.String |
handleError(org.springframework.web.servlet.NoHandlerFoundException e,
java.util.Locale locale) |
protected java.lang.String |
handleError(java.lang.Throwable e,
java.util.Locale locale) |
protected java.lang.String |
handleException(java.lang.Throwable error,
java.util.Locale locale) |
public ExceptionTranslator(org.springframework.context.MessageSource messageSource)
public java.lang.String handle(java.lang.Throwable error)
error - Throwableprotected java.lang.String handleException(java.lang.Throwable error,
java.util.Locale locale)
protected java.lang.String handleError(org.springframework.web.bind.MissingServletRequestParameterException e,
java.util.Locale locale)
protected java.lang.String handleError(org.springframework.web.bind.MethodArgumentNotValidException e)
protected java.lang.String handleError(org.springframework.validation.BindException e)
protected java.lang.String handleError(javax.validation.ConstraintViolationException e)
protected java.lang.String handleError(org.springframework.web.servlet.NoHandlerFoundException e,
java.util.Locale locale)
protected java.lang.String handleError(org.springframework.web.HttpRequestMethodNotSupportedException e,
java.util.Locale locale)
protected java.lang.String handleError(org.springframework.web.HttpMediaTypeNotSupportedException e,
java.util.Locale locale)
protected java.lang.String handleError(LocalizedException e, java.util.Locale locale)
protected java.lang.String handleError(java.lang.Throwable e,
java.util.Locale locale)
protected java.lang.String getMessage(java.lang.Throwable e,
java.util.Locale locale,
java.lang.Object[] values)
protected java.lang.String getMessage(java.lang.String msgKey,
java.util.Locale locale,
java.lang.Object[] values)