how to set dynamic variable and pass it to JSF like spring mvc?
In spring, I can do like this
Map<String, Object> model = new HashMap<String, Object>();
model.putAll(runtimeService.getV开发者_JS百科ariables(executionId));
return new ModelAndView("page1", model);
runtimeService.getVariables(executionId) is returning a map For example,
String Object
"id" "123"
"value" "4"
Then i can directly use ${id} to access the value
Variable name "id" is dynamic,
I am not sure how to do it in JSF way, since it uses getters and setters.
This should be simple, i am new to JSF :)
Thanks in advance.
You can have a Map
in your Managed Bean
and render it on XHTML using #
@ManagedBean
@RequestScoped
public class PersonBean{
private Map<String, String> personPropertyMap;
//setter + getters
}
on page
#{personBean.personPropertyMap['property1']}
精彩评论