}
// don't forget to set the content to the correct mimetype
ServletActionContext.getResponse().setContentType(mimeType);
// get the feed from the stack that can be found by the feedName
SyndFeed feed = (SyndFeed) actionInvocation.getStack().findValue(feedName);
if (feed != null) {
if (encoding == null)
encoding = feed.getEncoding(); // second choice is whatever the feed specifies
if (encoding != null)
ServletActionContext.getResponse().setCharacterEncoding(encoding);
// If neither of the above work, we'll get the platform default.
if (logger.isDebugEnabled())
logger.debug("Found object on stack with expression '" + feedName + "': " + feed);
if (feedType != null) // if the feedType is specified, we'll override the one set in the feed object
feed.setFeedType(feedType);
SyndFeedOutput output = new SyndFeedOutput();
// we'll need the writer since Rome doesn't support writing to an outputStream yet
Writer out = null;
try {