Java examples for javax.faces.context:FacesContext
get Bundle for Java Server Face
import java.util.ResourceBundle; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; public class Main{ public static void main(String[] argv) throws Exception{ System.out.println(getBundle()); }/*from w w w.j av a2s.c o m*/ private static ResourceBundle bundle; private static ResourceBundle getBundle() { if (bundle == null) { FacesContext context = FacesContext.getCurrentInstance(); bundle = context.getApplication().getResourceBundle(context, "msgs"); } return bundle; } }