[Converter] - Issue when using <f:converter />

From: Matthias Wessendorf <>
Date: Wed, 5 Sep 2007 18:07:17 +0200


I noticed an issue, when using the <f:converter /> tag.
The issue I noticed is present with these two RI version:

Running my application with version "1.2_03", the issue isn't there.

In Apache MyFaces Trinidad, we replace the standard NumberConverter,
by our own converter, for instance to have support for client side

The trinidad-impl...jar/META-INF/faces-config.xml does this:

<display-name>Number Converter</display-name>

To make it clear, this NumberConverter extends the standard
NumberConverter. Here is the hierarchy:

  |_ org.apache.myfaces.trinidad.convert.NumberConverter
       |_ org.apache.myfaces.trinidadinternal.convert.NumberConverter

So, the problem is, when doing this in a JSPX file

<inputXyz ...>
  <f:converter converterId="javax.faces.Number" />

The converter is instanceof

When doing this:
<inputXyz ...>
  <tr:converterNumber />

The converter is instanceof

Since our "converter replacements" like:
(to name only three)

are implementing "extra" interfaces, like
we are doing checks like

if (converter instanceof ClientConverter)

therefore usage of "<f:converter converterId="javax.faces.Number" />"
causes some issues.
I expected that this converter would be our replaced converter, but
it's instanceof
"com.sun.faces.taglib.jsf_core.ConverterTag$BindingConverter". So a
check against the "extra" interfaces isn't possible, when using
<f:converter ... />

Another issue that could come up with this, is that someone creates a
"custom converter", that implements the Trinidad API
ClientConverter-Interfaces as well, but the developer is to lazy to
provide a tag... The only usage would be <f:converter /> but, this
custom converter will never be handled as a client-converter.


Matthias Wessendorf
further stuff:
mail: matzew-at-apache-dot-org