Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何缩短资源包调用?复合组件?_Java_Jsf_Resourcebundle - Fatal编程技术网

Java 如何缩短资源包调用?复合组件?

Java 如何缩短资源包调用?复合组件?,java,jsf,resourcebundle,Java,Jsf,Resourcebundle,我对内置JSF资源包的可能性不太满意,比如: <h:outputFormat value="#{messages['form.label.create']}"> 因此,我尝试编写自己的复合组件,以缩短以下内容: <composite:interface> <composite:attribute name="value" /> <composite:attribute name="p1" /> </composite

我对内置JSF资源包的可能性不太满意,比如:

<h:outputFormat value="#{messages['form.label.create']}">

因此,我尝试编写自己的复合组件,以缩短以下内容:

<composite:interface>

    <composite:attribute name="value" />
    <composite:attribute name="p1" />

</composite:interface>


<composite:implementation>
    <h:outputFormat value="#{messages['cc.attrs.value']}"> //text.properties
        <f:param value="#{cc.attrs.p1}" />
    </h:outputFormat>
</composite:implementation>

//text.properties
用法:

<cc:messages value="label.name" p1="#{test}" />

但是表达式
messages['cc.attrs.value']
在资源包中查找cc.attrs.*而不是获取值内容


我能忘记我的方法吗?有人知道如何做类似的事情吗?

试着写
消息[cc.attrs.value]

JSF将
'cc.attrs.value'
解释为字符串值而不是变量名