}
@Override
public int doEndTag() throws JspException {
final ServletRequest request = pageContext.getRequest();
final ServletResponse response = pageContext.getResponse();
// get the current feed
Feed feed = getFeed(request);
// we need tags for that
/*
* feed.addEntry(null);
*/
// write the feed
try {
response.setContentType("application/atom+xml");
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(
getClass().getClassLoader());
try {
feed.writeTo(response.getOutputStream());
} finally {
Thread.currentThread().setContextClassLoader(classLoader);
}
} catch (IOException e) {
throw new JspException("Unable to write feed", e);