can get value of hashMap with [] in jsf? -
in jsf file hava:
<f:facet > #{main.res['core_common_label_actions'] </f:facet> and in bean hava
public map<string, string> getres() { return resourcebean.getresourcesmap(currentlocale); } that main.res['core_common_lable_action'] refer getres() , invok it.
what []?can value of hashmap [] insteadof get()?
yes. can map value []. try this:
private map<string, object> objects = new hashmap<string, object>(); public void add(string key, object value) { objects.put(key, value); } public map<string, object> getobjectsmap() { return objects; } for example have entry :
add("hi" , "test"); then can value this:
#{yourbean.objectsmap['hi']} it work;
Comments
Post a Comment