Access .properties files


import com.ibm.xsp.context.FacesContextEx;
import java.util.Properties;

private static final String lang_file = "_crm.properties";
private String locale = "de";

private String getLangString(String key) {
	Properties prop;
	prop = new Properties();
	String strLangString = "";
	try {
		  prop.load(FacesContextEx.getCurrentInstance().getExternalContext().getResourceAsStream(this.locale + lang_file));
		  strLangString = prop.getProperty(key);
	}catch(Exception e) {
		  strLangString = "";
	}
	return strLangString;
}
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...