@Override public String getContentType() { return config.getContentType(); }
/** * <p>Set the default content type (with optional character encoding) for * all responses if requested. <strong>NOTE</strong> - This header will * be overridden automatically if a <code>RequestDispatcher.forward</code> * call is ultimately invoked.</p> * * @param request The servlet request we are processing * @param response The servlet response we are creating */ protected void processContent(HttpServletRequest request, HttpServletResponse response) { String contentType = moduleConfig.getControllerConfig().getContentType(); if (contentType != null) { response.setContentType(contentType); } }
/** * <p>Set the default content type (with optional character encoding) for * all responses if requested. <strong>NOTE</strong> - This header will * be overridden automatically if a * <code>RequestDispatcher.forward</code> call is * ultimately invoked.</p> * * @param request The servlet request we are processing * @param response The servlet response we are creating */ protected void processContent(HttpServletRequest request, HttpServletResponse response) { String contentType = moduleConfig.getControllerConfig().getContentType(); if (contentType != null) { response.setContentType(contentType); } }
/** * <p>Check to see if the content type is set, and if so, set it for this * response.</p> * * @param actionCtx The <code>Context</code> for the current request * @return <code>false</code> so that processing continues * @throws Exception if thrown by the Action class */ public boolean execute(ActionContext actionCtx) throws Exception { // Retrieve the ModuleConfig instance ModuleConfig moduleConfig = actionCtx.getModuleConfig(); // If the content type is configured, set it for the response String contentType = moduleConfig.getControllerConfig().getContentType(); if (contentType != null) { setContentType(actionCtx, contentType); } return (false); }