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 33 34 public abstract class AbstractSetLocaleCommand implements Command { 35 36 37 39 40 43 private String localeKey = "locale"; 44 45 46 50 public String getLocaleKey() { 51 52 return (this.localeKey); 53 54 } 55 56 57 63 public void setLocaleKey(String localeKey) { 64 65 this.localeKey = localeKey; 66 67 } 68 69 70 72 73 81 public boolean execute(Context context) throws Exception { 82 83 setLocale(context, 84 (Locale ) context.get(getLocaleKey())); 85 return (false); 86 87 } 88 89 90 92 93 96 protected abstract void setLocale(Context context, Locale locale); 97 98 99 } 100 | Popular Tags |