@Override public boolean getNocache() { return config.getNocache(); }
/** * <p>Set the no-cache headers 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 processNoCache(HttpServletRequest request, HttpServletResponse response) { if (moduleConfig.getControllerConfig().getNocache()) { response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache,no-store,max-age=0"); response.setDateHeader("Expires", 1); } }
/** * <p>Set the no-cache headers 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 processNoCache(HttpServletRequest request, HttpServletResponse response) { if (moduleConfig.getControllerConfig().getNocache()) { response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache,no-store,max-age=0"); response.setDateHeader("Expires", 1); } }
/** * <p>Check to see if the controller is configured to prevent caching, and * if so, request no cache flags to be set.</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 module is configured for no caching, request no caching if (moduleConfig.getControllerConfig().getNocache()) { requestNoCache(actionCtx); } return (false); }