Hi Werner
check the faces-config.xml file and make sure the bean is not declared as a managed bean for jsf. That may be the reason why you have two instances. You will still be able to access the bean if it was registered though the ContextListener.
Mathias
Werner Punz schrieb:
Br�kelmann wrote:
Ok another problem as it seems, I did it, and it is in the servlet context, but once I try to access the bean through the JSF config definition another bean is generated with application scope, somehow the bean itself is generated twice, once by my class and stored in the servlet context, and then by JSF-MyFaces and then stored somewhere else.Hi Werner,
Implement javax.servlet.ServletContextListener to initialize that bean.
To make that implementation of javax.servlet.ServletContextListener known place
<listener> <listener-class>full.qualified.class.name</listener-class> </listener>
into web.xml
Register the bean through ServletContextEvent.getServletContext().setAttribute(String, Object). Where the first attribute contains the name of the bean and the second attribute the bean itself. It should be available in jsf pages.
Mathias
I�d rather have the bean stored at the correct context place so that myfaces/faces does not generated a second instance upon the next request within the system.

