在JSF里有这种可能吗?
<ui:composition>
<x:reusableCode id="editScreen">InnerHtml ... </x:reusableCode>
code...
<x:use component="editScreen"/>
</ui:composition
我知道我可以创建我自己的组件 并注册在jsf标签Lib, 但我需要重复使用 HTML 仅在 jsf 视图文件中。
在JSF里有这种可能吗?
<ui:composition>
<x:reusableCode id="editScreen">InnerHtml ... </x:reusableCode>
code...
<x:use component="editScreen"/>
</ui:composition
我知道我可以创建我自己的组件 并注册在jsf标签Lib, 但我需要重复使用 HTML 仅在 jsf 视图文件中。
在 Flacelets 1.x 中, 您可以为此创建标签文件 。
创建 /WEB-INF/tags/some.xhtml
:
<ui:composition
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
>
<h:outputText value="#{foo}" />
</ui:composition>
在 /WEB-INF/my.taglib.xml
中定义:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE facelet-taglib PUBLIC
"-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN"
"http://java.sun.com/dtd/facelet-taglib_1_0.dtd">
<facelet-taglib>
<namespace>http://example.com/jsf/facelets</namespace>
<tag>
<tag-name>some</tag-name>
<source>/WEB-INF/tags/some.xhtml</source>
</tag>
</facelet-taglib>
在 /WEB-INF/web.xml
中注册:
<context-param>
<param-name>facelets.LIBRARIES</param-name>
<param-value>/WEB-INF/my.taglib.xml</param-value>
</context-param>
(注意, 有多个时注意, 使用分号 < code>; code> 来分离它们) em>
最后,请在主页模板中声明。
<ui:composition
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:my="http://example.com/jsf/facelets"
>
<my:some foo="value1" />
<my:some foo="value2" />
<my:some foo="value3" />
</ui:composition>
这里可以找到一个更先进的例子: 注:JSF 2.0有针对性,但根据上述例子稍有改动,它对Faceletles 1.x有用。
We have a search form where the filter is bound to a property on a managed bean (session scope). It s not component binding, its property binding like <h:inputText value="#{searchBean.filter}"/>....
I m having trouble with a JSF selectManyCheckbox and A4J support. The purpose is to run some action when a checkbox is selected. This works perfectly in Firefox. Yet, when testing in any IE (ie6 / ie7 ...
Can anyone teach me how to use mojarra to encode my JSF files. I downloaded mojarra and expected some kind of jar but what i had downloaded was a folder of files i don t know what to do with
在共同基金中,如果用户要求终止,就需要采取一些行动。 我需要某种拦截器,但我不知道如何这样做。 我需要帮助。 增 编
Is there any way of just getting the content of the browsed file without any upload/file transfer operations? I currently use ICEFaces inputFile component but I do not need the default uploading ...
I have two JSPs where I am displaying some info from database in a h:dataTable. One of them is showing all the info, and one of them user specifically. I have showXML.jsp that shows the "XML" column ...
The problem is, that after displaying the ResultSet with <h:dataTable>, the connection is left open. If I close it, it closes the ResultSet too. I m thinking about copying the ResultSet data ...
How do I submit only part of a page in ADF Faces?