JSF 2.2 HTML5传递属性 [英] JSF 2.2 HTML5 Pass-through attributes

查看:270
本文介绍了JSF 2.2 HTML5传递属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I am trying to use JSF 2.2 innovations html5 pass-through attributes feature.

与m09版本一起使用的组件标签上的名称分隔属性.

Name-spaced attribute on the component tag working with m09 version.

<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>

但不适用于较新的版本.

But do not work with newer versions.

f:passThroughAttributes标记适用于较新的版本.

The f:passThroughAttributes tag is working with newer versions.

为什么?

推荐答案

您应使用以下命名空间:

You should use the following namespace :

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

说明:

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

The new namespace xmlns.jcp.org must be used for the new passthrough stuff for 2.2 (since this is new for 2.2). You can use the old (java.sun.com) or new (xmlns.jcp.org) namespace for the ui, h and f namespaces since we need to preserve compatibility. But I would encourage you to use the new namespace for everything going forward for 2.2.

这是JIRA参考:传递属性在与为属性分配前缀http://java.sun.com/jsf/passthrough

这篇关于JSF 2.2 HTML5传递属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆