Martlark
Martlark

Reputation: 14581

How to enumerate and initialise beans in spring/jsf

After my user logins, i'd like to enumerate all of the beans faces-config and initialize selectivly some of the beans, what is the best way of doing this? The beans are initialized by spring when the application session starts, but not just after the login process (via JAAS) finishes. I guess I'm asking how to enumerate the beans listed in your faces-config file.

Upvotes: 2

Views: 483

Answers (1)

Romain Linsolas
Romain Linsolas

Reputation: 81607

Could you rephrase your question, I don't really get what you want to do...

Spring is normally in charge of initilizing the bean for you. You can define a method for initialization like that :

<bean name="myBean" class="foo.bar.MyBean" init-method="initialize" scope="..."/>

and :

public class MyBean {
    ...
    public void initialize() {
        // This method will be executed once the bean is created by Spring.
    }
}

Upvotes: 1

Related Questions