|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.support.WebContentGenerator
org.springframework.web.servlet.mvc.AbstractController
es.mcu.yingo.controladores.SuperControlador
es.mcu.yingo.controladores.ControladorExceptionResolver
public class ControladorExceptionResolver
Controlador de Yingo para personalizar la gestión de excepciones en la
parte web de spring.
.
Implementa HandlerExceptionResolver y se debe de definir en
el contexto de sprig con el id "exceptionResolver"
Ejemplo de utilización
....
| Field Summary | |
|---|---|
static java.lang.String |
ATRIBUTO_EXCEPCION
Clave del atributo de la petición web donde se cargará la excepción |
protected org.apache.commons.logging.Log |
logger
Atributo para la generación de losgs |
protected SpringContextUtilWeb |
springContextUtilWeb
Objeto de utilidades del contexto de Spring para la parte Web |
private java.util.Map<java.lang.String,java.lang.String> |
vistaError
Vista donde se enviarça el error |
| Fields inherited from class es.mcu.yingo.controladores.SuperControlador |
|---|
BUSCAR, CARGA, CLAVE_DATOS_RESULTADO, FICHERO, INICIO, PAGINAR, PARAM_LISTA_ERROR |
| Fields inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
HEADER_CACHE_CONTROL, HEADER_EXPIRES, HEADER_PRAGMA, METHOD_GET, METHOD_HEAD, METHOD_POST |
| Constructor Summary | |
|---|---|
ControladorExceptionResolver()
|
|
| Method Summary | |
|---|---|
SpringContextUtilWeb |
getSpringContextUtilWeb()
Utilidad de manejo de contexto, que hace uso del request |
java.util.Map<java.lang.String,java.lang.String> |
getVistaError()
|
protected org.springframework.web.servlet.ModelAndView |
handleRequestInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
|
private org.springframework.web.servlet.ModelAndView |
mostrarError(java.lang.String mensajeError,
javax.servlet.http.HttpServletRequest request)
Envía el mensaje de error a la vista de error con la clave 'mensajeError' |
private org.springframework.web.servlet.ModelAndView |
mostrarWarning(java.lang.String mensajeError,
javax.servlet.http.HttpServletRequest request)
Envía el mensaje de error a la vista de error con la clave 'mensajeWarning' |
private java.lang.String |
obtenerMensajeI18n(ExcepcionConMensajeI18n t,
javax.servlet.http.HttpServletRequest request)
Obtiene el mensaje internacionalizado de la Excepcion |
org.springframework.web.servlet.ModelAndView |
resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object objeto,
java.lang.Exception excepcion)
Método principal que resuleve la excepción.Comprueba lo siguiente: Comprueba si la excepción es del tipo YingoException
obtiene el mensaje internacionalizado a partir del idioma que
tiene cargado el usuario en sesion. |
void |
setSpringContextUtilWeb(SpringContextUtilWeb springContextUtilWeb)
Utilidad de manejo de contexto, que hace uso del request |
void |
setVistaError(java.util.Map<java.lang.String,java.lang.String> vistaError)
|
| Methods inherited from class es.mcu.yingo.controladores.SuperControlador |
|---|
getAccion, obtenerVistaAplicacion, recogerParametro, recogerTipoTareaRequest |
| Methods inherited from class org.springframework.web.servlet.mvc.AbstractController |
|---|
handleRequest, isSynchronizeOnSession, setSynchronizeOnSession |
| Methods inherited from class org.springframework.web.servlet.support.WebContentGenerator |
|---|
applyCacheSeconds, applyCacheSeconds, cacheForSeconds, cacheForSeconds, checkAndPrepare, checkAndPrepare, getCacheSeconds, getSupportedMethods, isRequireSession, isUseCacheControlHeader, isUseExpiresHeader, preventCaching, setCacheSeconds, setRequireSession, setSupportedMethods, setUseCacheControlHeader, setUseExpiresHeader |
| Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
|---|
getServletContext, getTempDir, getWebApplicationContext, isContextRequired |
| Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
|---|
getApplicationContext, getMessageSourceAccessor, initApplicationContext, requiredContextClass, setApplicationContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final org.apache.commons.logging.Log logger
protected SpringContextUtilWeb springContextUtilWeb
private java.util.Map<java.lang.String,java.lang.String> vistaError
public static final java.lang.String ATRIBUTO_EXCEPCION
| Constructor Detail |
|---|
public ControladorExceptionResolver()
| Method Detail |
|---|
protected org.springframework.web.servlet.ModelAndView handleRequestInternal(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
throws java.lang.Exception
handleRequestInternal in class org.springframework.web.servlet.mvc.AbstractControllerjava.lang.Exception
public org.springframework.web.servlet.ModelAndView resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object objeto,
java.lang.Exception excepcion)
YingoException
obtiene el mensaje internacionalizado a partir del idioma que
tiene cargado el usuario en sesion. Si es de tipo
WarningYingoException trata el mensaje de
diferente manera enviandolo como avisoMaxUploadSizeExceededExceptiony personaliza el
mensaje de error
resolveException in interface org.springframework.web.servlet.HandlerExceptionResolver
private org.springframework.web.servlet.ModelAndView mostrarError(java.lang.String mensajeError,
javax.servlet.http.HttpServletRequest request)
mensajeError - request -
private org.springframework.web.servlet.ModelAndView mostrarWarning(java.lang.String mensajeError,
javax.servlet.http.HttpServletRequest request)
mensajeError - request -
private java.lang.String obtenerMensajeI18n(ExcepcionConMensajeI18n t,
javax.servlet.http.HttpServletRequest request)
t - request -
public SpringContextUtilWeb getSpringContextUtilWeb()
SuperControlador
getSpringContextUtilWeb in class SuperControladorpublic void setSpringContextUtilWeb(SpringContextUtilWeb springContextUtilWeb)
SuperControlador
setSpringContextUtilWeb in class SuperControladorspringContextUtilWeb - Carga el atributo springContextUtilWebpublic java.util.Map<java.lang.String,java.lang.String> getVistaError()
public void setVistaError(java.util.Map<java.lang.String,java.lang.String> vistaError)
vistaError - Carga el atributo vistaError
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||