<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.1">
</HEAD>
<BODY>
Converters are a great tool, and I use them all the time -- problem is, I sometimes need to use more than one converter (rich text processing, for example) and that leaves me having to write my own converter chain class, instantiating that class in a bean, then binding it to my Facelet component through EL.<BR>
<BR>
This seems like a lot of work, when what I'd really like to see is chaining support out of the box. I see two potential issues to prevent this:<BR>
<BR>
&nbsp;&nbsp;&nbsp; Object -&gt; String<BR>
<BR>
&nbsp;&nbsp;&nbsp; String -&gt; Object<BR>
<BR>
Right now, chains only operate on strings. which could cause some confusion, potentially, but I see reasons to enable multiple converters per component, and convert (in list style) in the order in which the converters were added. <BR>
<BR>
We allow multiple validators, but not multiple converters. This caveat recently bit me as Kito found out, I was converting URLs into &lt;a&gt;&nbsp; tags as part of a comment output component. In order to accomplish this, I was disabling encoding on the component itself, so that the converted output &lt;a&gt; tag would not be rendered as text. I had attached a converter prior to the link converter that was supposed to take care of the escaping. Problem is... the last converter added in the Facelets file wins because only one is allowed, so my site was (until I fixed it) vulnerable to XSS attacks - a BIG problem.<BR>
<BR>
I propose adding converter chaining, by default, to UIComponent. In effect, turning converters into filters. This isn't a hard change, doesn't add much complexity, but does fix one of those things that people end up having to do themselves (Seam provides a ConverterChain, and I did some Googling to find that many other people are doing this themselves.) This is low hanging fruit that we can pick.<BR>
<BR>
Thoughts?<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
---<BR>
Lincoln Baxter, III<BR>
<A HREF="http://ocpsoft.com">http://ocpsoft.com</A><BR>
<A HREF="http://scrumshark.com">http://scrumshark.com</A><BR>
&quot;Keep it Simple&quot; <BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>