Add error message for missing servlet request param.

The DefaultHandlerExceptionResolver now provides an error message in
addition to setting the status of the response.

Issue: SPR-9312
This commit is contained in:
Rossen Stoyanchev
2012-08-21 12:35:17 -04:00
parent 1cf4a2facd
commit 06d95915a0
3 changed files with 12 additions and 10 deletions

View File

@@ -22,13 +22,13 @@ import org.springframework.web.multipart.MultipartResolver;
/**
* Raised when the part of a "multipart/form-data" request identified by its
* name cannot be found.
*
* <p>This may be because the request is not a multipart/form-data
*
* either because the part is not present in the request, or
* because the web application is not configured correctly for processing
* multipart requests -- e.g. no {@link MultipartResolver}.
* name cannot be found.
*
* <p>This may be because the request is not a multipart/form-data
*
* either because the part is not present in the request, or
* because the web application is not configured correctly for processing
* multipart requests -- e.g. no {@link MultipartResolver}.
*
* @author Rossen Stoyanchev
* @since 3.1
@@ -40,7 +40,7 @@ public class MissingServletRequestPartException extends ServletException {
private final String partName;
public MissingServletRequestPartException(String partName) {
super("Request part '" + partName + "' not found.");
super("Required request part '" + partName + "' is not present.");
this.partName = partName;
}