// Path: src/zblog/viewer/RSSView.java
// public class RSSView extends AbstractView {
// 
// 	private Dao dao;
// 
// 	public void setDao(Dao dao) {
// 		this.dao = dao;
// 	}
// 
// 	@SuppressWarnings("rawtypes")
// 	@Override
// 	protected void renderMergedOutputModel(Map model,
// 			HttpServletRequest request, HttpServletResponse response)
// 			throws Exception {
// 		response.setContentType("application/xhtml+xml");
// 		response.setCharacterEncoding("UTF-8");
// 
// 		Blog blog = dao.getBlogDao().get();
// 
// 		SyndFeed feed = createFeed(blog);
// 
// 		List<SyndEntry> entries = new ArrayList<SyndEntry>();
// 		for (Article article : dao.getArticleDao().listLatest()) {
// 			entries.add(createEntry(blog, article));
// 		}
// 		feed.setEntries(entries);
// 
// 		SyndFeedOutput output = new SyndFeedOutput();
// 		PrintWriter writer = new PrintWriter(new OutputStreamWriter(
// 				response.getOutputStream(), "UTF-8"));
// 		output.output(feed, writer);
// 	}
// 
// 	private SyndEntry createEntry(Blog blog, Article article) {
// 		SyndEntry entry = new SyndEntryImpl();
// 		entry.setTitle(article.getTitle());
// 		entry.setPublishedDate(article.getCreateDate());
// 		entry.setLink("http://" + blog.getHost() + "/show.html?id="
// 				+ article.getKey().getId());
// 
// 		entry.setAuthor(article.getAuthor().getNickname());
// 
// 		SyndContent content = new SyndContentImpl();
// 		content.setType("text/html");
// 		content.setValue(article.getContent());
// 		entry.setDescription(content);
// 
// 		SyndCategory category = new SyndCategoryImpl();
// 		category.setName(article.getCatelog());
// 
// 		List<SyndCategory> categories = new ArrayList<SyndCategory>();
// 		categories.add(category);
// 
// 		entry.setCategories(categories);
// 
// 		return entry;
// 	}
// 
// 	private SyndFeed createFeed(Blog blog) {
// 		SyndFeed feed = new SyndFeedImpl();
// 		feed.setFeedType("rss_2.0");
// 		feed.setEncoding("UTF-8");
// 		feed.setTitle(blog.getName());
// 		feed.setDescription(blog.getDescription());
// 		feed.setLink("http://" + blog.getHost());
// 		feed.setLanguage("zh-cn");
// 		feed.setAuthor(blog.getAuthor().getNickname());
// 		return feed;
// 	}
// }


import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import zblog.viewer.RSSView;

package zblog.controller;




public class RSSController extends AbstractController {

	private RSSView rssView;


// Path: src/zblog/viewer/RSSView.java
// public class RSSView extends AbstractView {
// 
// 	private Dao dao;
// 
// 	public void setDao(Dao dao) {
// 		this.dao = dao;
// 	}
// 
// 	@SuppressWarnings("rawtypes")
// 	@Override
// 	protected void renderMergedOutputModel(Map model,
// 			HttpServletRequest request, HttpServletResponse response)
// 			throws Exception {
// 		response.setContentType("application/xhtml+xml");
// 		response.setCharacterEncoding("UTF-8");
// 
// 		Blog blog = dao.getBlogDao().get();
// 
// 		SyndFeed feed = createFeed(blog);
// 
// 		List<SyndEntry> entries = new ArrayList<SyndEntry>();
// 		for (Article article : dao.getArticleDao().listLatest()) {
// 			entries.add(createEntry(blog, article));
// 		}
// 		feed.setEntries(entries);
// 
// 		SyndFeedOutput output = new SyndFeedOutput();
// 		PrintWriter writer = new PrintWriter(new OutputStreamWriter(
// 				response.getOutputStream(), "UTF-8"));
// 		output.output(feed, writer);
// 	}
// 
// 	private SyndEntry createEntry(Blog blog, Article article) {
// 		SyndEntry entry = new SyndEntryImpl();
// 		entry.setTitle(article.getTitle());
// 		entry.setPublishedDate(article.getCreateDate());
// 		entry.setLink("http://" + blog.getHost() + "/show.html?id="
// 				+ article.getKey().getId());
// 
// 		entry.setAuthor(article.getAuthor().getNickname());
// 
// 		SyndContent content = new SyndContentImpl();
// 		content.setType("text/html");
// 		content.setValue(article.getContent());
// 		entry.setDescription(content);
// 
// 		SyndCategory category = new SyndCategoryImpl();
// 		category.setName(article.getCatelog());
// 
// 		List<SyndCategory> categories = new ArrayList<SyndCategory>();
// 		categories.add(category);
// 
// 		entry.setCategories(categories);
// 
// 		return entry;
// 	}
// 
// 	private SyndFeed createFeed(Blog blog) {
// 		SyndFeed feed = new SyndFeedImpl();
// 		feed.setFeedType("rss_2.0");
// 		feed.setEncoding("UTF-8");
// 		feed.setTitle(blog.getName());
// 		feed.setDescription(blog.getDescription());
// 		feed.setLink("http://" + blog.getHost());
// 		feed.setLanguage("zh-cn");
// 		feed.setAuthor(blog.getAuthor().getNickname());
// 		return feed;
// 	}
// }


// Path: src/zblog/controller/RSSController.java
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractController;
import zblog.viewer.RSSView;

package zblog.controller;




public class RSSController extends AbstractController {

	private RSSView rssView;


	public void setRssView(RSSView rssView) {
