0
我测试JSF组件,但我得到的NullPointerException :(问题的代码是:的getAttributes()获得( “的attributeName”)在UIComponent构造返回null
@FacesComponent(value="mycomponent0")
public class MyComponent extends HtmlPanelGroup{
MyComponent(){
String a0=this.getAttributes().get("attr0");
}
}
的taglib.xml的标记包含attr0属性和标签的用法是:
<abc:mycomponent attr0="helloworld"></abc:mycomponent>
所以我的问题是什么原因造成的问题,以及如何处理它
感谢
?
阅读BalusC答案在这里,为解释: https://stackoverflow.com/questions/30404268/cannot-get-custom-component -attribute从 - 支持bean – Pazura