Skip to content

Commit e6481a0

Browse files
committed
Deprecate "feed" and "document" view packages
Prior to this commit, Spring Framework would ship several abstract `*View` implementations for rendering PDF, RSS or XLS documents using well-known libraries. More recently, supporting libraries evolved a lot with new versions and forks. Spring Framework is not in a position to efficiently support all variants within the project. This commit deprecates the relevant classes. Instead, libraries can reuse existing code and ship optional support for Spring directly. Often, updating imports and library usage is enough. As an alternative, applications can decide to perform rendering direclty in web handlers. Closes gh-35451
1 parent 2e4ca41 commit e6481a0

File tree

13 files changed

+39
-0
lines changed

13 files changed

+39
-0
lines changed

framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-document.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
Spring offers ways to return output other than HTML, including PDF and Excel spreadsheets.
55
This section describes how to use those features.
66

7+
WARNING: As of Spring Framework 7.0, view classes in the `org.springframework.web.servlet.view.document`
8+
package are deprecated. Instead, libraries can adapt this existing code to provide support with their own `*View` types.
9+
As an alternative, applications can perform direct rendering in web handlers.
710

811
[[mvc-view-document-intro]]
912
== Introduction to Document Views
1013

14+
1115
An HTML page is not always the best way for the user to view the model output,
1216
and Spring makes it simple to generate a PDF document or an Excel spreadsheet
1317
dynamically from the model data. The document is the view and is streamed from the

framework-docs/modules/ROOT/pages/web/webmvc-view/mvc-feeds.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
[[mvc-view-feeds]]
22
= RSS and Atom
33

4+
WARNING: As of Spring Framework 7.0, view classes in the `org.springframework.web.servlet.view.feed`
5+
package are deprecated. Instead, libraries can adapt this existing code to provide support with their own `*View` types.
6+
As an alternative, applications can perform direct rendering in web handlers.
7+
48
Both `AbstractAtomFeedView` and `AbstractRssFeedView` inherit from the
59
`AbstractFeedView` base class and are used to provide Atom and RSS Feed views, respectively. They
610
are based on https://rometools.github.io/rome/[ROME] project and are located in the

spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfStamperView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@
4545
* @author Juergen Hoeller
4646
* @since 2.5.4
4747
* @see AbstractPdfView
48+
* @deprecated since 7.0. Libraries or applications can provide their own {@code View}
49+
* class or perform rendering in web handlers directly.
4850
*/
51+
@Deprecated(since = "7.0", forRemoval = true)
4952
public abstract class AbstractPdfStamperView extends AbstractUrlBasedView {
5053

5154
public AbstractPdfStamperView(){

spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractPdfView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@
4848
* @author Juergen Hoeller
4949
* @author Jean-Pierre Pawlak
5050
* @see AbstractPdfStamperView
51+
* @deprecated since 7.0. Libraries or applications can provide their own {@code View}
52+
* class or perform rendering in web handlers directly.
5153
*/
54+
@Deprecated(since = "7.0", forRemoval = true)
5255
public abstract class AbstractPdfView extends AbstractView {
5356

5457
/**

spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractXlsView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
*
3737
* @author Juergen Hoeller
3838
* @since 4.2
39+
* @deprecated since 7.0. Libraries or applications can provide their own {@code View}
40+
* class or perform rendering in web handlers directly.
3941
*/
42+
@Deprecated(since = "7.0", forRemoval = true)
4043
public abstract class AbstractXlsView extends AbstractView {
4144

4245
/**

spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractXlsxStreamingView.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@
3333
*
3434
* @author Juergen Hoeller
3535
* @since 4.2
36+
* @deprecated since 7.0. Libraries or applications can provide their own {@code View}
37+
* class or perform rendering in web handlers directly.
3638
*/
39+
@Deprecated(since = "7.0", forRemoval = true)
40+
@SuppressWarnings("removal")
3741
public abstract class AbstractXlsxStreamingView extends AbstractXlsxView {
3842

3943
/**

spring-webmvc/src/main/java/org/springframework/web/servlet/view/document/AbstractXlsxView.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@
3131
*
3232
* @author Juergen Hoeller
3333
* @since 4.2
34+
* @deprecated since 7.0. Libraries or applications can provide their own {@code View}
35+
* class or perform rendering in web handlers directly.
3436
*/
37+
@Deprecated(since = "7.0", forRemoval = true)
38+
@SuppressWarnings("removal")
3539
public abstract class AbstractXlsxView extends AbstractXlsView {
3640

3741
/**

spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractAtomFeedView.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@
4343
* @see #buildFeedMetadata
4444
* @see #buildFeedEntries
4545
* @see <a href="https://www.atomenabled.org/developers/syndication/">Atom Syndication Format</a>
46+
* @deprecated since 7.0. Libraries or applications can provide their own {@code View}
47+
* class or perform rendering in web handlers directly.
4648
*/
49+
@Deprecated(since = "7.0", forRemoval = true)
50+
@SuppressWarnings("removal")
4751
public abstract class AbstractAtomFeedView extends AbstractFeedView<Feed> {
4852

4953
/**

spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractFeedView.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@
4646
* @param <T> the {@link WireFeed} type
4747
* @see AbstractRssFeedView
4848
* @see AbstractAtomFeedView
49+
* @deprecated since 7.0. Libraries or applications can provide their own {@code View}
50+
* class or perform rendering in web handlers directly.
4951
*/
52+
@Deprecated(since = "7.0", forRemoval = true)
5053
public abstract class AbstractFeedView<T extends WireFeed> extends AbstractView {
5154

5255
@Override

spring-webmvc/src/main/java/org/springframework/web/servlet/view/feed/AbstractRssFeedView.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@
4444
* @since 3.0
4545
* @see #buildFeedMetadata
4646
* @see #buildFeedItems
47+
* @deprecated since 7.0. Libraries or applications can provide their own {@code View}
48+
* class or perform rendering in web handlers directly.
4749
*/
50+
@Deprecated(since = "7.0", forRemoval = true)
51+
@SuppressWarnings("removal")
4852
public abstract class AbstractRssFeedView extends AbstractFeedView<Channel> {
4953

5054
public AbstractRssFeedView() {

0 commit comments

Comments
 (0)