jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] Re: Feedback over JSF 2.2 spec

From: Frank Caputo <frank_at_frankcaputo.de>
Date: Fri, 30 Nov 2012 21:08:06 +0100

Hi Leonardo,

Am 29.11.2012 um 04:55 schrieb Leonardo Uribe <lu4242_at_gmail.com>:

> - Shouldn't be possible to define TagDecorator in faces-config.xml under
> <faces-config-extension><facelets-processing> ? In my opinion it has a
> lot of sense, because with a custom TagDecorator you can for example
> convert an <input type="email"/> into an <x:email >, which could simplify
> facelets markup. Define this with only one web config has the problem that
> you need to define this in your webapp. With an entry in faces-config.xml,
> it is possible to provide a jar file with the TagDecorator implementation
> and it will be loaded automatically.

Sounds good.

> - It is possible to apply multiple TagDecorator implementations? If that so,
> how can you disable or replace the default implementation? Is a good idea
> to provide a TagDecoratorFactory?.

In Mojarra you can't apply multiple TagDecorator implementations to one tag (which is stated in the javadoc of TagDecorator). Once a TagDecorator successfully decorated a tag, the process is ended. The only exception is the DefaultTagDecorator, which handles the new jsf: syntax. It runs first and then the users tag decorators will be applied.

See https://svn.java.net/svn/mojarra~svn/trunk/jsf-ri/src/main/java/com/sun/faces/facelets/tag/CompositeTagDecorator.java and https://svn.java.net/svn/mojarra~svn/trunk/jsf-api/src/main/java/javax/faces/view/facelets/TagDecorator.java

Ciao Frank