IoC and JSF bean

G

guess85

Hi everybody. I try to write a factory using IoC pattern. This factory
open an ontology model and returns a unique reference to this model.
The associated bean have scope application. This model is used in many
class. In every class I have a reference to this model like :

MyModelFactory factory;

and I use this reference to get the model with:

OntModel model=factory.getModel();

and in the faces-config.xml I have:

<managed-bean>
<description>Bean of the student</description>
<managed-bean-name>studentBean</managed-bean-name>
<managed-bean-class>beanDomain.StudentBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>factory</property-name>
<value>#{myModelFactory}</value>
</managed-property>
</managed-bean>

But when i try use factory.getModel() it returns an empty value. It
seems like it don't have any reference to the factory bean. Why? There
is something wrong? Thanks..
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top