|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
Exception resolver that allows for mapping exception class names to view names, either for a list of given handlers or for all handlers in the DispatcherServlet.
Error views are analogous to error page JSPs, but can be used with any kind of exception including any checked one, with fine-granular mappings for specific handlers.
Field Summary | |
static java.lang.String |
DEFAULT_EXCEPTION_ATTRIBUTE
|
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
SimpleMappingExceptionResolver()
|
Method Summary | |
protected ModelAndView |
getModelAndView(java.lang.String viewName,
java.lang.Exception ex)
Return a ModelAndView for the given view name and exception. |
int |
getOrder()
Return the order value of this object, higher value meaning greater in terms of sorting. |
ModelAndView |
resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
java.lang.Exception ex)
Try to resolve the given exception that got thrown during on handler execution, returning a ModelAndView that represents a specific error page if appropriate. |
void |
setDefaultErrorView(java.lang.String defaultErrorView)
Set the name of the default error view. |
void |
setExceptionAttribute(java.lang.String exceptionAttribute)
Set the name of the model attribute as which the exception should be exposed. |
void |
setExceptionMappings(java.util.Properties mappings)
Set the mappings between exception class names and view names. |
void |
setMappedHandlers(java.util.List mappedHandlers)
Set the list of handlers that this exception resolver should map. |
void |
setOrder(int order)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String DEFAULT_EXCEPTION_ATTRIBUTE
protected final org.apache.commons.logging.Log logger
Constructor Detail |
public SimpleMappingExceptionResolver()
Method Detail |
public void setOrder(int order)
public int getOrder()
Ordered
Higher value can be interpreted as lower priority, consequently the first object has highest priority (somewhat analogous to Servlet "load-on-startup" values).
getOrder
in interface Ordered
public void setExceptionMappings(java.util.Properties mappings) throws java.lang.ClassNotFoundException
mappings
- fully qualified exception class names as keys,
and view names as values
java.lang.ClassNotFoundException
public void setDefaultErrorView(java.lang.String defaultErrorView)
public void setMappedHandlers(java.util.List mappedHandlers)
public void setExceptionAttribute(java.lang.String exceptionAttribute)
DEFAULT_EXCEPTION_ATTRIBUTE
public ModelAndView resolveException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Object handler, java.lang.Exception ex)
HandlerExceptionResolver
resolveException
in interface HandlerExceptionResolver
request
- current HTTP requestresponse
- current HTTP responsehandler
- the executed handler, or null if none chosen at the time of
the exception (for example, if multipart resolution failed)ex
- the exception that got thrown during handler execution
protected ModelAndView getModelAndView(java.lang.String viewName, java.lang.Exception ex)
viewName
- the name of the error viewex
- the exception that got thrown during handler execution
setExceptionAttribute(java.lang.String)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |