Hello,
I'm writing a converter for my JSF webapp; my class implements the Converter interface and the boths methods getAsObject and getAsString.
For the method getAsObject, I need a manager of my Service layer.
I added an attribute "manager" in my Converter class and a setter.
I use Spring IoC; so my Manager object is a bean declared in my ApplicationContext.xml file.
In my faces-config.xml, I declared the element:
<application> <variable-resolver> org.springframework.web.jsf.DelegatingVariableResolver </variable-resolver> <locale-config/> </application>
I have a problem now: I do not know how to make to state my converter in order to inject my bean Manager to him.
I have for the moment tested that:
<converter>
<converter-id>MyConverter</converter-id>
<converter-class>com.jsf.MyConverter</converter-class>
<property>
<property-name>mgr</property-name>
<property-class>com.service. Manager</property-class>
<suggested-value># {manager} </suggested-value>
</property>
</converter>
and that does not go, mgr in the MonConverter object is null.
I checked if the setter of the manager in the MonConverter class were called, and it is it. However, the parameter of the setter is null.