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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -