|
14 | 14 | @Controller |
15 | 15 | public class ArticleRssController { |
16 | 16 |
|
17 | | - @GetMapping(value = "/rss0") |
| 17 | + @GetMapping(value = "/rss1") |
18 | 18 | public String articleMvcFeed() { |
19 | 19 | return "articleFeedView"; |
20 | 20 | } |
21 | 21 |
|
22 | | - @GetMapping(value = "/rss1") |
23 | | - @ResponseBody |
24 | | - public SyndFeed articleRestFeed1() throws FeedException { |
25 | | - SyndFeed feed = new SyndFeedImpl(); |
26 | | - feed.setFeedType("rss_2.0"); |
27 | | - feed.setLink("http://localhost:8080/spring-mvc-simple/rss"); |
28 | | - feed.setTitle("Article Feed"); |
29 | | - feed.setDescription("Article Feed Description"); |
30 | | - feed.setPublishedDate(new Date()); |
31 | | - |
32 | | - List list = new ArrayList<SyndEntry>(); |
33 | | - |
34 | | - SyndEntry item1 = new SyndEntryImpl(); |
35 | | - item1.setLink("http://www.baeldung.com/netty-exception-handling"); |
36 | | - item1.setTitle("Exceptions in Netty"); |
37 | | - SyndContent description1 = new SyndContentImpl(); |
38 | | - description1.setValue("In this quick article, we’ll be looking at exception handling in Netty."); |
39 | | - item1.setDescription(description1); |
40 | | - item1.setPublishedDate(new Date()); |
41 | | - item1.setAuthor("Carlos"); |
42 | | - |
43 | | - SyndEntry item2 = new SyndEntryImpl(); |
44 | | - item2.setLink("http://www.baeldung.com/cockroachdb-java"); |
45 | | - item2.setTitle("Guide to CockroachDB in Java"); |
46 | | - SyndContent description2 = new SyndContentImpl(); |
47 | | - description2.setValue("This tutorial is an introductory guide to using CockroachDB with Java."); |
48 | | - item2.setDescription(description2); |
49 | | - item2.setPublishedDate(new Date()); |
50 | | - item2.setAuthor("Baeldung"); |
51 | | - |
52 | | - list.add(item1); |
53 | | - list.add(item2); |
54 | | - feed.setEntries(list); |
55 | | - |
56 | | - // return new SyndFeedOutput().outputString(feed); |
57 | | - return feed; |
58 | | - } |
59 | | - |
60 | 22 | @GetMapping(value = "/rss2") |
61 | 23 | @ResponseBody |
62 | 24 | public ArticleFeed articleRestFeed2() { |
|
0 commit comments