can't use <converter-for-class> on managed bean

Hi all,

With my Customer managed bean in the request scope, I am able to use an <h:inputHidden> and custom converter to pass it from request to request:

<h:inputHidden value="#{customer}" immediate="true">

<f:converter converterId="CustomerConverter"/>

</h:inputHidden>

I just don't understand why JSF requires me to specify the converter. If I specify a <converter-for-class> and just do

<h:inputHidden value="#{customer}" immediate="true"/>

the bean is not converted from a String back to a Customer (although it is successfully converted to a String).

It seems that the inputHidden needs to check the class of #{customer} to decide what converter, if any, to use. Since it is a managed bean, I would have expected this to cause the bean to be created and the correct converter chosen, but this is not the case.

It must have something to do with the way root EL variables are resolved right? There is no ?.setCustomer() method so how is the #{customer} updated?

Cheers,

Roger

[1216 byte] By [Roger_Keaysa] at [2007-10-2 21:54:55]
# 1
Probably you bean isn't serializable.
pringia at 2007-7-14 1:10:56 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...