output.output(feed, response.getWriter());
output.output(feed, response.getWriter());
output.output(feed, response.getWriter());
output.output(value, new OutputStreamWriter(baos)); baos.close(); } catch (final IOException ex) {
output.output(value, new OutputStreamWriter(baos)); baos.close(); } catch (final IOException ex) {
/** * Dispatch the view using ROME * * @param request the request * @param response the resopnse * @param context the the servlet context * @throws ServletException */ public void dispatch(HttpServletRequest request, HttpServletResponse response, ServletContext context) throws ServletException { SyndFeed syndFeed = getFeed(); syndFeed.setFeedType(getFeedType().getFeedType()); SyndFeedOutput output = new SyndFeedOutput(); try { output.output(syndFeed, response.getWriter()); } catch (IOException e) { throw new ServletException("Error generating feed", e); } catch (FeedException e) { throw new ServletException("Error generating feed", e); } }
try { out = ServletActionContext.getResponse().getWriter(); output.output(feed, out); } catch(Exception ex) { ex.printStackTrace();
@Override protected void get(IServletRequest req, IServletResponse res) throws IOException { try { SyndFeed feed = getFeed(req); String feedType = req.getParameter(FEED_TYPE); feedType = (feedType != null) ? feedType : defaultFeedType; feed.setFeedType(feedType); HttpUtil.setContentType(res, MIME_TYPE); SyndFeedOutput output = new SyndFeedOutput(); output.output(feed, res.writer()); } catch (FeedException | ParseException ex) { GlobalConfig.ASTERIX_LOGGER.log(Level.WARN, ex.getMessage(), ex); String msg = COULD_NOT_GENERATE_FEED_ERROR; res.writer().print(msg); res.setStatus(HttpResponseStatus.INTERNAL_SERVER_ERROR); } }