Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JSF 2.2 HTML5 Pass-through attributes

Tags:

html

jsf-2

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?

like image 842
Rhododendron Avatar asked Oct 19 '25 13:10

Rhododendron


1 Answers

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

like image 180
Daniel Avatar answered Oct 22 '25 04:10

Daniel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!