【问题标题】:JSF 2.2 HTML5 Pass-through attributesJSF 2.2 HTML5 传递属性
【发布时间】:2013-06-08 20:04:01
【问题描述】:

我正在尝试使用 JSF 2.2 创新的 html5 传递属性功能。

使用 m09 版本的组件标签上的名称间隔属性。

<dependency>
   <groupId>org.glassfish</groupId>
   <artifactId>javax.faces</artifactId>
   <version>2.2.0-m09</version>
</dependency>

 

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://java.sun.com/jsf/passthrough">
  <h:head>
    <title>HTML 5</title>
  </h:head>
  <h:body>
    <h:inputText p:placeholder="Enter text"/>    
  </h:body>
</html>

但不适用于较新的版本。

f:passThroughAttributes 标签适用于较新的版本。

为什么?

【问题讨论】:

    标签: html jsf-2


    【解决方案1】:

    您应该使用以下命名空间:

    xmlns="http://xmlns.jcp.org/jsf/passthrough"
    

    解释:

    新的命名空间 xmlns.jcp.org 必须用于 2.2 的新直通内容(因为这是 2.2 的新名称)。 您可以为 ui、h 和 f 命名空间使用旧的 (java.sun.com) 或新的 (xmlns.jcp.org) 命名空间,因为我们需要保持兼容性。但我鼓励您将新的命名空间用于 2.2 的所有内容。

    这里是 JIRA 参考:Passthrough attributes not working when used with prefixing the attribute with the shortname assigned to the http://java.sun.com/jsf/passthrough

    【讨论】:

    猜你喜欢
    • 2016-01-22
    • 1970-01-01
    • 2014-08-07
    • 1970-01-01
    • 1970-01-01
    • 2011-11-07
    • 2012-11-10
    • 1970-01-01
    • 2014-02-13
    相关资源
    最近更新 更多