【问题标题】:JSF Custom component attribute properties with Annotations带有注释的 JSF 自定义组件属性
【发布时间】:2015-01-02 15:05:45
【问题描述】:

我想制作一个自定义组件 'foo' 并带有一个名为 'bar' 的属性。

在 JSF 2.2 中,我可以在没有任何 taglib 文件的情况下在 Java 中创建 Component 类:

@FacesComponent(tagName = "foo", createTag = true)
public class Foo {

    @WhatShouldIUseHere(required = true, description = "example attribute")
    public Object getBar() { ... }

}

但我对 bar 属性有疑问。是否存在任何注释,我可以在 taglib xml 中设置所需、描述和其他属性?

【问题讨论】:

    标签: jsf jsf-2


    【解决方案1】:

    没有任何注释可以做你想做的事。

    如果你还不知道如何为你的自定义 JSF 组件添加属性,你可以看这里:Adding custom attribute (HTML5) support to JSF 2.0 UIInput component

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-05-21
      • 1970-01-01
      • 1970-01-01
      • 2011-11-05
      • 2013-08-08
      • 2014-02-06
      • 1970-01-01
      相关资源
      最近更新 更多