1 16 package org.apache.myfaces.examples.util; 17 18 import javax.faces.context.FacesContext; 19 import java.util.Enumeration ; 20 import java.util.ResourceBundle ; 21 22 27 public class ExampleMessagesResourceBundle 28 extends ResourceBundle 29 { 30 private static String BUNDLE_NAME = "org.apache.myfaces.examples.resource.example_messages"; 31 32 protected ResourceBundle getMyBundle() 33 { 34 FacesContext facesContext = FacesContext.getCurrentInstance(); 35 return ResourceBundle.getBundle(BUNDLE_NAME, facesContext.getViewRoot().getLocale()); 36 } 37 38 protected Object handleGetObject(String key) 39 { 40 return getMyBundle().getObject(key); 41 } 42 43 public Enumeration getKeys() 44 { 45 return getMyBundle().getKeys(); 46 } 47 } 48 | Popular Tags |