You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Stephen Connolly <st...@gmail.com> on 2010/04/13 10:27:01 UTC

Re: [Trinidad] Regarding PartialTriggers attribute

On 12 February 2010 14:54, preeti agarwal <pr...@gmail.com> wrote:

> Hi
>       For our Application we wanted to raise partialTriggers based on
> three components. Accidentally till now we were using commas to separate
> them and it worked fine.
>
> <tr:panelGroupLayout id="panelGroup#{count}"
> partialTriggers="link#{count},h_anchors#{count},expandAll">
>
> We use :
> Trinidad                        1.2.12
> jsf-facelets                    1.1.14
> JBoss                           4.2.1
>
>
>
> Now when we tried to run this in other environment (other than JBoss),
> it gives error saying
>
> java.lang.IllegalArgumentException: Cannot convert selectedReaction of
> type class java.lang.String to class [Ljava.lang.String;
>
>
> When we searched in Trinidad Doc it recommends to use spaces instead of
> commas. Then we found in
> http://issues.apache.org/jira/browse/TRINIDAD-1417 that we need to use
> EL expressions as even spaces don't work.
>
> Now some FAQs regarding this:
>
> 1)      Why commas were working in JBoss environment since it's not
> supported as per the document? Does any jar allowed it?
>
> 2)      If it was working in JBoss then why it failed in the new
> environment?
>

It seems that JBoss and/or Seam uses it's own EL support classes... these
will fall back to the PropertyEditor's if all else fails.
It would appear that either in your JBoss server a StringArrayPropertyEditor
has been registered, or else JBoss registers such
a property editor by default (perhaps for the JMX console)

The new environment does not have such a property editor registered.

[Preeti: Before you go running back and emailing me to say that somebody on
the trinidad list found a solution, check who's sending this mail ;-) ]

The hack is to register a StringArrayPropertyEditor in the container.  This
does not fix the original issue.  The original issue is best fixed by using
an EL function to convert the string to a string array, as not every
container is as ameanable to registering custom PropertyEditor's on start-up
as Jetty.

BTW.  Registering a custom property editor in a Servlet Context Listener is
a potential ClassLoader leak as PropertyEditorManager is in the global
classloader and would contain a reference to the class from the deployed
application.  Additionally, as PropertyEditorManager is in the global
classloader, the hack has the potential to break any other applications
deployed to the container / break the container.  That is why using an EL
function is the correct and only solution.


> 3)      Is there any fix regarding spaces issue?
>
>
>
>
> Thanks and Regards,
>
> Preeti Agarwal
>