Java Solutions

Tuesday, July 16, 2013

JSF Reference Card

Programmatically Accessing values from Resource Bundle

public class JSFUtil {
   [...]
 
   public String getResourceValue(String key,String parameters[]){
     FacesContext context = FacesContext.getCurrentInstance();
     ResourceBundle rb =context.getApplication().getResourceBundle(context,"resource_bundle_name");
     String value = rb.getValue("key")
     return MessageFormat.format(value,parameters);
   }
}

updating...

Posted by amer sohail at 12:19 AM
Labels: bundle, jsf, MessageFormat, programmatically, resource

No comments:

Post a Comment

Newer Post Older Post Home
Subscribe to: Post Comments (Atom)

Popular Posts

  • How to Set Path for Java In Mac
    First step is to find where is java installed. For that open terminal and type the below command /usr/libexec/java_home This command wi...
  • Learning IOS Programming for Java Developers - Memory Management in Setters and Getters Of Object
    Encapsulation is one of the basic building block in Object Oriented paradigm. Encapsulation in Java is achieve by restricting user to direct...
  • Packaging j2se application in jar
    Jar file is distributable unit for j2se applications. It is a zipped file but with jar extension. Jar file contains following contents: - Ja...
  • Spring Framework Pitfalls
    UndeclaredThrowableException thrown This exception may occur when you are manipulating exception and changing it to exception type thrown...
  • Cloning of Java objects
    Parent class of all objects in java is "Object" which contains several important methos. One of them is "clone" which is...

Blog Archive

  • ►  2018 (1)
    • ►  March (1)
  • ►  2014 (3)
    • ►  September (1)
    • ►  March (1)
    • ►  January (1)
  • ▼  2013 (4)
    • ►  December (1)
    • ▼  July (2)
      • JSF Reference Card
      • JPA Reference Card
    • ►  April (1)
  • ►  2012 (4)
    • ►  November (2)
    • ►  October (2)
  • ►  2011 (7)
    • ►  November (1)
    • ►  March (3)
    • ►  February (3)
  • ►  2010 (2)
    • ►  July (1)
    • ►  May (1)
  • ►  2009 (9)
    • ►  December (3)
    • ►  October (5)
    • ►  May (1)
  • ►  2008 (10)
    • ►  October (1)
    • ►  August (1)
    • ►  July (3)
    • ►  June (3)
    • ►  May (1)
    • ►  April (1)

Visitors

visitors by country counter
flag counter

Followers

Simple theme. Powered by Blogger.