Announcement Announcement Module
Collapse
No announcement yet.
@ResponseBody retuning RSS problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • @ResponseBody retuning RSS problem

    Hi

    I have been trying to return RSS using the @ResponseBody annotation as follows:

    Code:
    @RequestMapping(value="/rss", method=RequestMethod.GET)
    	public @ResponseBody Channel writeChannel() {
    
    		Channel channel = new Channel();
    		channel.setFeedType("rss_2.0");
    		channel.setTitle("My RSS feed");
    		channel.setDescription("Description");
    		channel.setLink("http://localhost:8080/my-app            /notification/rss");
    		return channel;
    	}
    I have imported Rome as a dependency:

    Code:
           <dependency>
      		<groupId>net.java.dev.rome</groupId>
      		<artifactId>rome</artifactId>
      		<version>1.0.0</version>
    	</dependency>
    No matter what I do, every time I hit this url I receive a json string back representing the channel object.

    Even http://localhost:8080/my-app/notification/rss.xml returns an xml file but when opened the contents are json. In other places in my application I return xml to a flex front-end and have no problems there, however all my entity classes which I convert to xml are labeled with the @XmlRootElement tag.

    Any help would be greatly appreciated.
Working...
X