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.logging.Log; 23 import org.apache.commons.logging.LogFactory; 24 import org.apache.struts.config.ActionConfig; 25 26 27 34 35 public class SelectInclude implements Command { 36 37 38 40 41 private String actionConfigKey = Constants.ACTION_CONFIG_KEY; 42 private String includeKey = Constants.INCLUDE_KEY; 43 44 private static final Log log = 45 LogFactory.getLog(SelectInclude.class); 46 47 48 50 51 56 public String getActionConfigKey() { 57 58 return (this.actionConfigKey); 59 60 } 61 62 63 70 public void setActionConfigKey(String actionConfigKey) { 71 72 this.actionConfigKey = actionConfigKey; 73 74 } 75 76 77 81 public String getIncludeKey() { 82 83 return (this.includeKey); 84 85 } 86 87 88 94 public void setIncludeKey(String includeKey) { 95 96 this.includeKey = includeKey; 97 98 } 99 100 101 103 104 112 public boolean execute(Context context) throws Exception { 113 114 ActionConfig actionConfig = (ActionConfig) 116 context.get(getActionConfigKey()); 117 118 String include = actionConfig.getInclude(); 120 if (include != null) { 121 if (log.isDebugEnabled()) { 122 log.debug("Including " + include); 123 } 124 context.put(getIncludeKey(), include); 125 } 126 return (false); 127 128 } 129 130 } 131 | Popular Tags |