4

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

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.

The f:passThroughAttributes tag is working with newer versions.

Why?

Rhododendron
  • 559
  • 2
  • 7
  • 15

1 Answers1

11

You should use the following namespace :

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

Explanation:

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.

Here is the JIRA reference : Passthrough attributes not working when used with prefixing the attribute with the shortname assigned to the http://java.sun.com/jsf/passthrough

Daniel
  • 36,833
  • 10
  • 119
  • 200
  • Thank you daniel. Is IDE's(example netbeans intelij) does not support automatic code completion? – Rhododendron Jun 09 '13 at 08:28
  • You are welcome, They all does , take a look at this : https://netbeans.org/kb/docs/web/jsf20-support.html and this http://stackoverflow.com/questions/2058175/how-to-reactivate-code-assist-in-my-xhtml-page-eclipse-3-5-jboss-tools-3-1-js – Daniel Jun 09 '13 at 08:59
  • This should be `xmlns:p="http://xmlns.jcp.org/jsf/passthrough"` according to https://docs.oracle.com/javaee/7/javaserver-faces-2-2/vdldocs-facelets/p/tld-summary.html – Kawu Jan 29 '21 at 06:53