, Serializable
* the {@code Expires} header.
* The date is returned as the number of milliseconds since January 1, 1970 GMT.
* Returns -1 when the date is unknown.
- *
* @return the expires value
*/
public long getExpires() {
@@ -786,8 +781,6 @@ public class HttpHeaders implements MultiValueMap, Serializable
return getFirst(UPGRADE);
}
- // Date methods
-
/**
* Parse the first header value for the given header name as a date, return -1 if
* there is no value, or raise {@link IllegalArgumentException} if the value cannot be
@@ -823,8 +816,6 @@ public class HttpHeaders implements MultiValueMap, Serializable
set(headerName, dateFormat.format(new Date(date)));
}
- // Single string methods
-
/**
* Return the first header value for the given header name, if any.
* @param headerName the header name
@@ -885,6 +876,7 @@ public class HttpHeaders implements MultiValueMap, Serializable
return singleValueMap;
}
+
// Map implementation
@Override
@@ -970,4 +962,12 @@ public class HttpHeaders implements MultiValueMap, Serializable
return this.headers.toString();
}
+
+ /**
+ * Return a {@code HttpHeaders} object that can only be read, not written to.
+ */
+ public static HttpHeaders readOnlyHttpHeaders(HttpHeaders headers) {
+ return new HttpHeaders(headers, true);
+ }
+
}
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java
index 532e705f6e..b6190911f2 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/DispatcherServlet.java
@@ -1282,7 +1282,7 @@ public class DispatcherServlet extends FrameworkServlet {
}
private void triggerAfterCompletionWithError(HttpServletRequest request, HttpServletResponse response,
- HandlerExecutionChain mappedHandler, Error error) throws Exception, ServletException {
+ HandlerExecutionChain mappedHandler, Error error) throws Exception {
ServletException ex = new NestedServletException("Handler processing failed", error);
if (mappedHandler != null) {