Class DefaultNuxeoExceptionHandler
java.lang.Object
org.nuxeo.ecm.platform.web.common.exceptionhandling.DefaultNuxeoExceptionHandler
- All Implemented Interfaces:
NuxeoExceptionHandler
- Direct Known Subclasses:
SecurityExceptionHandler
,ShibbolethSecurityExceptionHandler
- Author:
- arussel
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final com.fasterxml.jackson.databind.ObjectMapper
protected NuxeoExceptionHandlerParameters
Fields inherited from interface org.nuxeo.ecm.platform.web.common.exceptionhandling.NuxeoExceptionHandler
EXCEPTION_HANDLER_MARKER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
getExceptionMessage
(String message, int status) protected ErrorHandler
getLoginURL
(javax.servlet.http.HttpServletRequest request) Gets the URL to redirect to when a login is needed for an Anonymous user.protected Principal
getPrincipal
(javax.servlet.http.HttpServletRequest request) boolean
handleAnonymousException
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Handles the Security Error when the user is anonymous.void
handleException
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Throwable t) void
setParameters
(NuxeoExceptionHandlerParameters parameters) protected void
startHandlingException
(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Throwable t) Puts a marker in request to avoid looping over the exception handling mechanismprotected void
writeExceptionAsJson
(javax.servlet.http.HttpServletResponse response, int status, Throwable e)
-
Field Details
-
MAPPER
protected static final com.fasterxml.jackson.databind.ObjectMapper MAPPER -
parameters
-
-
Constructor Details
-
DefaultNuxeoExceptionHandler
public DefaultNuxeoExceptionHandler()
-
-
Method Details
-
setParameters
- Specified by:
setParameters
in interfaceNuxeoExceptionHandler
-
startHandlingException
protected void startHandlingException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Throwable t) throws javax.servlet.ServletException Puts a marker in request to avoid looping over the exception handling mechanism- Throws:
javax.servlet.ServletException
- if request has already been marked as handled. The initial exception is then wrapped.
-
handleException
public void handleException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Throwable t) throws IOException, javax.servlet.ServletException - Specified by:
handleException
in interfaceNuxeoExceptionHandler
- Throws:
IOException
javax.servlet.ServletException
-
handleAnonymousException
public boolean handleAnonymousException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws IOException, javax.servlet.ServletException Description copied from interface:NuxeoExceptionHandler
Handles the Security Error when the user is anonymous.- Specified by:
handleAnonymousException
in interfaceNuxeoExceptionHandler
- Returns:
true
if the Security Error is handled so that the calling method won't fallback on the default handler,false
otherwise.- Throws:
IOException
javax.servlet.ServletException
-
getLoginURL
Description copied from interface:NuxeoExceptionHandler
Gets the URL to redirect to when a login is needed for an Anonymous user.- Specified by:
getLoginURL
in interfaceNuxeoExceptionHandler
-
getHandler
-
getPrincipal
-
writeExceptionAsJson
protected void writeExceptionAsJson(javax.servlet.http.HttpServletResponse response, int status, Throwable e) throws IOException - Throws:
IOException
-
getExceptionMessage
-