Let's say I have this request:
myview.xhtml?a=1&b=par1&b=par2
In myview.xhtml
<f:metadata>
<f:viewParam name="a" value="#{myBean.a}"/>
<f:viewParam name="b" value="#{myBean.b}"/>
</f:metadata>
In MyBean
@ManagedProperty("#{param.a}")
String a;
@ManagedProperty("#{param.b}")
String b;
I thought that setB(String b)
would be invoked twice, so I can add the items to a List
, but it was invoked just once, with the first value (par1
).
I also tried to transform b into a List<String>
but JSF is not evaluating as a List
.
So, my question is how to inject multiple parameter values with the same key, using @ManagedProperty
. (right now I am getting the paramterValues
manually)