如何向未定义这些属性的组件添加新属性而不创建自己的属性。
我想做这样的事情
<h:commandButton actionListener="#{manager.saveNew}" value="#{i18n['School.create']}" secured="true" />
或者至少是一种允许开发人员分配安全属性的方法。
有任何想法吗?
您可以使用f:attribute
在你的里面h:commandButton
.
<h:commandButton actionListener="#{manager.saveNew}
value="#{i18n['School.create']}">
<f:attribute name="secured" value="true" />
</h:commandButton>
在你的操作方法中:
public void saveNew(ActionEvent event) {
String secured = (String) event.getComponent().getAttributes().get("secured");
}
这里有一个综合教程 http://balusc.blogspot.com/2006/06/communication-in-jsf.html关于这个话题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)