in jsf2 if we have some function like
public String greeting(String gtr) {
return "Hello " + gtr;
}
then from jsf page we can call this function as
<h:outputLabel value="#{greetingBean.greeting['some-name']}"
now my question is i want to pass the dynamic parameter from the same bean class instead of ‘some-name’ something like value="#{greetingBean.greeting[greetingBean.name]} is it possible ?
i required this because i have value in Map<String, ArrayList> and want to edit particular ArrayList value ?
any suggestions ?
Brackets are used to replace the dot notation. That is,
is the same as
So, the
greetingmethod will not be called. Instead, JSF will try to access agreetingproperty, and then try to access asome-nameproperty of the object returned bygreetingproperty. That is, your code above is already generating an error.If you are using EL 2.2 and want to call an action, simply put:
or