1 16 package org.apache.commons.chain.web; 17 18 19 import java.util.Locale ; 20 import org.apache.commons.chain.Command; 21 import org.apache.commons.chain.Context; 22 23 24 32 33 public abstract class AbstractGetLocaleCommand implements Command { 34 35 36 38 39 42 private String localeKey = "locale"; 43 44 45 49 public String getLocaleKey() { 50 51 return (this.localeKey); 52 53 } 54 55 56 62 public void setLocaleKey(String localeKey) { 63 64 this.localeKey = localeKey; 65 66 } 67 68 69 71 72 80 public boolean execute(Context context) throws Exception { 81 82 context.put(getLocaleKey(), getLocale(context)); 83 return (false); 84 85 } 86 87 88 90 91 94 protected abstract Locale getLocale(Context context); 95 96 97 } 98 | Popular Tags |