List of usage examples for org.apache.commons.digester.rss Channel render
public void render(PrintWriter writer)
From source file:org.apache.struts.scaffold.rss.RenderRss.java
/** (* // :FIXME: Hasn't been tested./*from ww w .java2 s .c o m*/ * Retrieves a Digester Channel bean from request context and * renders it. * <p> * Channel bean must be stored under the attribute * ParseRss.CHANNEL_KEY or under an attribute given as the * parameter property. * * @param mapping The ActionMapping used to select this instance * @param form The optional ActionForm bean for this request * @param request The HTTP request we are processing * @param response The resonse we are creating * @fixme Use ActionForwards for links instead of properties */ public void executeLogic(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ActionErrors errors = new ActionErrors(); Channel channel = null; try { channel = (Channel) request.getAttribute(ParseRss.CHANNEL_KEY); } catch (Throwable t) { channel = null; } if (null == channel) { try { channel = (Channel) request.getAttribute(mapping.getParameter()); } catch (Throwable t) { channel = null; } } if (null == channel) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(Tokens.PROCESS_MISSING_PARAMETER)); } if (errors.empty()) { response.setContentType(Tokens.TEXT_PLAIN); channel.render(response.getWriter()); } else { // This will trigger findFailure() in the BaseAction saveErrors(request, errors); } }