1 16 17 package org.apache.struts.chain; 18 19 20 import org.apache.commons.chain.Command; 21 import org.apache.commons.chain.Context; 22 import org.apache.commons.chain.web.WebContext; 23 import org.apache.struts.config.ModuleConfig; 24 25 26 33 34 public abstract class AbstractRequestNoCache implements Command { 35 36 37 39 40 private String moduleConfigKey = Constants.MODULE_CONFIG_KEY; 41 42 43 45 46 51 public String getModuleConfigKey() { 52 53 return (this.moduleConfigKey); 54 55 } 56 57 58 65 public void setModuleConfigKey(String moduleConfigKey) { 66 67 this.moduleConfigKey = moduleConfigKey; 68 69 } 70 71 72 74 75 83 public boolean execute(Context context) throws Exception { 84 85 WebContext wcontext = (WebContext) context; 87 ModuleConfig moduleConfig = (ModuleConfig) 88 wcontext.get(getModuleConfigKey()); 89 90 if (moduleConfig.getControllerConfig().getNocache()) { 92 requestNoCache(context); 93 } 94 return (false); 95 96 } 97 98 99 101 102 107 protected abstract void requestNoCache(Context context); 108 109 110 } 111 | Popular Tags |