File tree Expand file tree Collapse file tree
spring-mvc-simple/src/main/java/com/baeldung/spring/controller/rss Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .baeldung .spring .controller .rss ;
22
3+ import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlProperty ;
34import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlElementWrapper ;
45import com .fasterxml .jackson .dataformat .xml .annotation .JacksonXmlRootElement ;
56
1011@ JacksonXmlRootElement (localName ="articles" )
1112public class ArticleFeed extends RssData implements Serializable {
1213
13- @ JacksonXmlElementWrapper (localName = "items" , useWrapping = true )
14+ @ JacksonXmlProperty (localName = "item" )
15+ @ JacksonXmlElementWrapper (useWrapping = false )
1416 private List <ArticleItem > items = new ArrayList <ArticleItem >();
1517
1618 public void addItem (ArticleItem articleItem ) {
Original file line number Diff line number Diff line change 44
55import java .io .Serializable ;
66
7- @ JacksonXmlRootElement (localName ="article" )
87public class ArticleItem extends RssData implements Serializable {
98 private String author ;
109
Original file line number Diff line number Diff line change 11package com .baeldung .spring .controller .rss ;
22
3- import com .rometools .rome .feed .synd .*;
4- import com .rometools .rome .io .FeedException ;
5- import com .rometools .rome .io .SyndFeedOutput ;
63import org .springframework .stereotype .Controller ;
74import org .springframework .web .bind .annotation .GetMapping ;
85import org .springframework .web .bind .annotation .ResponseBody ;
96
10- import java .util .ArrayList ;
117import java .util .Date ;
12- import java .util .List ;
138
149@ Controller
1510public class ArticleRssController {
You can’t perform that action at this time.
0 commit comments