diff --git a/org.springframework.web/.classpath b/org.springframework.web/.classpath
index f4fbe0249c9..5e6d64d01fb 100644
--- a/org.springframework.web/.classpath
+++ b/org.springframework.web/.classpath
@@ -15,7 +15,7 @@
-
+
diff --git a/org.springframework.web/ivy.xml b/org.springframework.web/ivy.xml
index 44140487a09..532dc81c1e9 100644
--- a/org.springframework.web/ivy.xml
+++ b/org.springframework.web/ivy.xml
@@ -43,7 +43,7 @@
-
+ javax.servletservlet-api
- 2.5
+ 3.0provided
diff --git a/org.springframework.web/src/test/java/org/springframework/mock/web/MockHttpServletRequest.java b/org.springframework.web/src/test/java/org/springframework/mock/web/MockHttpServletRequest.java
index 26f7171b58f..c8ea4249a72 100644
--- a/org.springframework.web/src/test/java/org/springframework/mock/web/MockHttpServletRequest.java
+++ b/org.springframework.web/src/test/java/org/springframework/mock/web/MockHttpServletRequest.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2009 the original author or authors.
+ * Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -18,6 +18,7 @@ package org.springframework.mock.web;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
@@ -34,19 +35,28 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
+
+import javax.servlet.AsyncContext;
+import javax.servlet.DispatcherType;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
import javax.servlet.ServletInputStream;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
+import javax.servlet.http.Part;
import org.springframework.util.Assert;
import org.springframework.util.LinkedCaseInsensitiveMap;
/**
* Mock implementation of the {@link javax.servlet.http.HttpServletRequest}
- * interface. Supports the Servlet 2.5 API level.
+ * interface. Supports the Servlet 2.5 API level; throws
+ * {@link UnsupportedOperationException} for all methods introduced in Servlet 3.0.
*
*
Used for testing the web framework; also useful for testing
* application controllers.
@@ -55,6 +65,7 @@ import org.springframework.util.LinkedCaseInsensitiveMap;
* @author Rod Johnson
* @author Rick Evans
* @author Mark Fisher
+ * @author Chris Beams
* @since 1.0.2
*/
public class MockHttpServletRequest implements HttpServletRequest {
@@ -847,4 +858,53 @@ public class MockHttpServletRequest implements HttpServletRequest {
return isRequestedSessionIdFromURL();
}
+
+ //---------------------------------------------------------------------
+ // Methods introduced in Servlet 3.0
+ //---------------------------------------------------------------------
+
+ public AsyncContext getAsyncContext() {
+ throw new UnsupportedOperationException();
+ }
+
+ public DispatcherType getDispatcherType() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isAsyncSupported() {
+ throw new UnsupportedOperationException();
+ }
+
+ public AsyncContext startAsync() {
+ throw new UnsupportedOperationException();
+ }
+
+ public AsyncContext startAsync(ServletRequest arg0, ServletResponse arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean isAsyncStarted() {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean authenticate(HttpServletResponse arg0) throws IOException, ServletException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Part getPart(String arg0) throws IOException, IllegalStateException, ServletException {
+ throw new UnsupportedOperationException();
+ }
+
+ public Collection getParts() throws IOException, IllegalStateException, ServletException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void login(String arg0, String arg1) throws ServletException {
+ throw new UnsupportedOperationException();
+ }
+
+ public void logout() throws ServletException {
+ throw new UnsupportedOperationException();
+ }
+
}
diff --git a/org.springframework.web/src/test/java/org/springframework/mock/web/MockHttpServletResponse.java b/org.springframework.web/src/test/java/org/springframework/mock/web/MockHttpServletResponse.java
index 46eb174615d..973ef580590 100644
--- a/org.springframework.web/src/test/java/org/springframework/mock/web/MockHttpServletResponse.java
+++ b/org.springframework.web/src/test/java/org/springframework/mock/web/MockHttpServletResponse.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2010 the original author or authors.
+ * Copyright 2002-2011 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@ import org.springframework.web.util.WebUtils;
/**
* Mock implementation of the {@link javax.servlet.http.HttpServletResponse}
- * interface. Supports the Servlet 2.5 API level.
+ * interface. Supports the Servlet 3.0 API level
*
*
Used for testing the web framework; also useful for testing
* application controllers.
@@ -292,9 +292,9 @@ public class MockHttpServletResponse implements HttpServletResponse {
* @param name the name of the header
* @return the associated header value, or null if none
*/
- public Object getHeader(String name) {
+ public String getHeader(String name) {
HeaderValueHolder header = HeaderValueHolder.getByName(this.headers, name);
- return (header != null ? header.getValue() : null);
+ return (header != null ? header.getValue().toString() : null);
}
/**
@@ -302,9 +302,9 @@ public class MockHttpServletResponse implements HttpServletResponse {
* @param name the name of the header
* @return the associated header values, or an empty List if none
*/
- public List