Skip to content

Commit 7ca2a5d

Browse files
committed
Early support for Jakarta Servlet 6.2 and Jakarta Activation 2.2
Closes gh-35670
1 parent 29d4a91 commit 7ca2a5d

4 files changed

Lines changed: 21 additions & 4 deletions

File tree

spring-context-support/src/main/java/org/springframework/mail/javamail/ConfigurableMimeFileTypeMap.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import java.io.File;
2020
import java.io.IOException;
2121
import java.io.InputStream;
22+
import java.nio.file.Path;
2223

2324
import jakarta.activation.FileTypeMap;
2425
import jakarta.activation.MimetypesFileTypeMap;
@@ -178,4 +179,9 @@ public String getContentType(String fileName) {
178179
return getFileTypeMap().getContentType(fileName);
179180
}
180181

182+
// @Override - on Activation 2.2
183+
public String getContentType(Path path) {
184+
return getFileTypeMap().getContentType(path.getFileName().toString());
185+
}
186+
181187
}

spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/**
5656
* Mock implementation of the {@link jakarta.servlet.http.HttpServletResponse} interface.
5757
*
58-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
58+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
5959
*
6060
* @author Juergen Hoeller
6161
* @author Rod Johnson
@@ -827,6 +827,10 @@ public int getStatus() {
827827
return this.errorMessage;
828828
}
829829

830+
// @Override - on Servlet 6.2
831+
public void sendEarlyHints() {
832+
}
833+
830834

831835
//---------------------------------------------------------------------
832836
// Methods for MockRequestDispatcher

spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockHttpServletResponse.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
/**
5656
* Mock implementation of the {@link jakarta.servlet.http.HttpServletResponse} interface.
5757
*
58-
* <p>As of Spring 6.0, this set of mocks is designed on a Servlet 6.0 baseline.
58+
* <p>As of Spring 7.0, this set of mocks is designed on a Servlet 6.1 baseline.
5959
*
6060
* @author Juergen Hoeller
6161
* @author Rod Johnson
@@ -827,6 +827,10 @@ public int getStatus() {
827827
return this.errorMessage;
828828
}
829829

830+
// @Override - on Servlet 6.2
831+
public void sendEarlyHints() {
832+
}
833+
830834

831835
//---------------------------------------------------------------------
832836
// Methods for MockRequestDispatcher

spring-webmvc/src/main/java/org/springframework/web/servlet/function/DefaultServerRequest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ public Collection<String> getHeaderNames() {
660660
return this.headers.headerNames();
661661
}
662662

663-
664663
// Unsupported
665664

666665
@Override
@@ -713,7 +712,6 @@ public void addIntHeader(String name, int value) {
713712
throw new UnsupportedOperationException();
714713
}
715714

716-
717715
@Override
718716
public String getCharacterEncoding() {
719717
throw new UnsupportedOperationException();
@@ -793,6 +791,11 @@ public void setLocale(Locale loc) {
793791
public Locale getLocale() {
794792
throw new UnsupportedOperationException();
795793
}
794+
795+
// @Override - on Servlet 6.2
796+
public void sendEarlyHints() {
797+
throw new UnsupportedOperationException();
798+
}
796799
}
797800

798801
}

0 commit comments

Comments
 (0)