public class GrailsExceptionResolver
extends org.springframework.web.servlet.handler.SimpleMappingExceptionResolver
implements org.springframework.web.context.ServletContextAware, org.codehaus.groovy.grails.plugins.support.aware.GrailsApplicationAware
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EXCEPTION_ATTRIBUTE |
protected org.codehaus.groovy.grails.commons.GrailsApplication |
grailsApplication |
protected static java.lang.String |
LINE_SEPARATOR |
protected static org.apache.commons.logging.Log |
LOG |
protected javax.servlet.ServletContext |
servletContext |
protected org.codehaus.groovy.grails.exceptions.StackTraceFilterer |
stackFilterer |
DEFAULT_EXCEPTION_ATTRIBUTE| Constructor and Description |
|---|
GrailsExceptionResolver() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createStackFilterer() |
protected java.lang.String |
determineUri(javax.servlet.http.HttpServletRequest request) |
static int |
extractLineNumber(org.codehaus.groovy.control.CompilationFailedException e) |
protected void |
filterStackTrace(java.lang.Exception e) |
protected java.lang.Exception |
findWrappedException(java.lang.Exception e) |
protected void |
forwardRequest(org.codehaus.groovy.grails.web.mapping.UrlMappingInfo info,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.web.servlet.ModelAndView mv,
java.lang.String uri) |
static java.lang.RuntimeException |
getFirstRuntimeException(java.lang.Throwable e) |
java.lang.String |
getRequestLogMessage(javax.servlet.http.HttpServletRequest request) |
protected java.lang.String |
getRequestLogMessage(java.lang.String exceptionName,
javax.servlet.http.HttpServletRequest request,
java.lang.String message) |
java.lang.String |
getRequestLogMessage(java.lang.Throwable e,
javax.servlet.http.HttpServletRequest request) |
static java.lang.Throwable |
getRootCause(java.lang.Throwable ex)
Obtains the root cause of the given exception
|
protected void |
logStackTrace(java.lang.Exception e,
javax.servlet.http.HttpServletRequest request) |
protected org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder |
lookupUrlMappings() |
protected org.codehaus.groovy.grails.web.mapping.UrlMappingInfo |
matchStatusCode(java.lang.Exception ex,
org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder urlMappings) |
org.springframework.web.servlet.ModelAndView |
resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
java.lang.Exception ex) |
protected void |
resolveView(javax.servlet.http.HttpServletRequest request,
org.codehaus.groovy.grails.web.mapping.UrlMappingInfo info,
org.springframework.web.servlet.ModelAndView mv) |
protected org.springframework.web.servlet.ModelAndView |
resolveViewOrForward(java.lang.Exception ex,
org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder urlMappings,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.web.servlet.ModelAndView mv) |
void |
setGrailsApplication(org.codehaus.groovy.grails.commons.GrailsApplication grailsApplication) |
void |
setServletContext(javax.servlet.ServletContext servletContext) |
protected void |
setStatus(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.web.servlet.ModelAndView mv,
java.lang.Exception e) |
addStatusCode, applyStatusCodeIfPossible, determineStatusCode, determineViewName, doResolveException, findMatchingViewName, getDepth, getModelAndView, getModelAndView, getStatusCodesAsMap, setDefaultErrorView, setDefaultStatusCode, setExceptionAttribute, setExceptionMappings, setExcludedExceptions, setStatusCodespublic static final java.lang.String EXCEPTION_ATTRIBUTE
protected static final org.apache.commons.logging.Log LOG
protected static final java.lang.String LINE_SEPARATOR
protected javax.servlet.ServletContext servletContext
protected org.codehaus.groovy.grails.commons.GrailsApplication grailsApplication
protected org.codehaus.groovy.grails.exceptions.StackTraceFilterer stackFilterer
public org.springframework.web.servlet.ModelAndView resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
java.lang.Object handler,
java.lang.Exception ex)
resolveException in interface org.springframework.web.servlet.HandlerExceptionResolverresolveException in class org.springframework.web.servlet.handler.AbstractHandlerExceptionResolverpublic java.lang.String getRequestLogMessage(java.lang.Throwable e,
javax.servlet.http.HttpServletRequest request)
public java.lang.String getRequestLogMessage(javax.servlet.http.HttpServletRequest request)
public void setServletContext(javax.servlet.ServletContext servletContext)
setServletContext in interface org.springframework.web.context.ServletContextAwarepublic void setGrailsApplication(org.codehaus.groovy.grails.commons.GrailsApplication grailsApplication)
setGrailsApplication in interface org.codehaus.groovy.grails.plugins.support.aware.GrailsApplicationAwarepublic static java.lang.Throwable getRootCause(java.lang.Throwable ex)
ex - The exceptionpublic static int extractLineNumber(org.codehaus.groovy.control.CompilationFailedException e)
public static java.lang.RuntimeException getFirstRuntimeException(java.lang.Throwable e)
protected void filterStackTrace(java.lang.Exception e)
protected void setStatus(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.web.servlet.ModelAndView mv,
java.lang.Exception e)
protected org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder lookupUrlMappings()
protected org.springframework.web.servlet.ModelAndView resolveViewOrForward(java.lang.Exception ex,
org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder urlMappings,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.web.servlet.ModelAndView mv)
protected void forwardRequest(org.codehaus.groovy.grails.web.mapping.UrlMappingInfo info,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.web.servlet.ModelAndView mv,
java.lang.String uri)
throws javax.servlet.ServletException,
java.io.IOException
javax.servlet.ServletExceptionjava.io.IOExceptionprotected java.lang.String determineUri(javax.servlet.http.HttpServletRequest request)
protected void resolveView(javax.servlet.http.HttpServletRequest request,
org.codehaus.groovy.grails.web.mapping.UrlMappingInfo info,
org.springframework.web.servlet.ModelAndView mv)
throws java.lang.Exception
java.lang.Exceptionprotected org.codehaus.groovy.grails.web.mapping.UrlMappingInfo matchStatusCode(java.lang.Exception ex,
org.codehaus.groovy.grails.web.mapping.UrlMappingsHolder urlMappings)
protected void logStackTrace(java.lang.Exception e,
javax.servlet.http.HttpServletRequest request)
protected java.lang.Exception findWrappedException(java.lang.Exception e)
protected java.lang.String getRequestLogMessage(java.lang.String exceptionName,
javax.servlet.http.HttpServletRequest request,
java.lang.String message)
protected void createStackFilterer()