public class MaxUploadSizeExceededExceptionResolver extends Object implements org.springframework.web.servlet.HandlerExceptionResolver
MaxUploadSizeExceededException
occurring during
multipart request resolution. The handler provides a localized error message to the view which
can be defined using request-mappings. The error message is available under the attribute
MessageHelper.ERROR_MESSAGES_KEY
. If there is no mapping for a request it will be
interpreted as an AJAX request and the response will be a JSON object holding the error message.
If the requests Accept header does not include application/json the JSON response should be
bundled in HTML. This must be handled by the view provided with
#setAjaxResponseView(String)
.Constructor and Description |
---|
MaxUploadSizeExceededExceptionResolver() |
Modifier and Type | Method and Description |
---|---|
org.springframework.web.servlet.ModelAndView |
resolveException(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
Object handler,
Exception ex)
Implementation of the exception resolving method which will only handle the
MaxUploadSizeExceededException . |
void |
setNonAjaxUploadRequestMappings(Map<String,String> requestMappings)
Define the resources which should not be handled as AJAX Uploads but instead should respond
with a custom view.
|
public MaxUploadSizeExceededExceptionResolver()
public org.springframework.web.servlet.ModelAndView resolveException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Object handler, Exception ex)
MaxUploadSizeExceededException
.resolveException
in interface org.springframework.web.servlet.HandlerExceptionResolver
request
- the current HTTP requestresponse
- the responsehandler
- the executed handler, which is null in case of an MaxUploadSizeExceededExceptionex
- the exception that got thrownpublic void setNonAjaxUploadRequestMappings(Map<String,String> requestMappings)
requestMappings
- a mapping from resource URI starting with a / after the client part to view nameCopyright © 2019 Communote team. All rights reserved.