How to register a JSF managed bean programmatically?

后端 未结 5 2132
悲&欢浪女
悲&欢浪女 2020-12-29 11:30

I\'d like to register/add a Managed Bean class programmatically (from within a Servlet init()) into application scope. How can I do that with JSF 1.2?

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 11:45

    Say I have registered my beans using

    ApplicationAssociate.getInstance(sc).getBeanManager().register(...)
    

    Now It is working fine, But then there is a server restart and my beans are destroyed, How on startup I can get the same bean registered.

提交回复
热议问题