You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by John <jo...@jak.com> on 2006/01/25 01:26:08 UTC

Managed beans not being instantiated

I'm having incredible difficulty getting a managed bean to be
instantiated.
 
-- I've gone to a very simple JavaBean for testing.
 
-- The managed bean XML is in faces-config.xml
 
-- I'm using Tobago
 
-- I'm using Tomcat 5.9 embedded within our application.
 
The beans constructor never gets called, although the JSF page displays
fine (except of course the beans values aren't displayed).
 
No errors.
 
 
I'm stumped.
 
John

Re: Managed beans not being instantiated

Posted by Simon Kitching <sk...@apache.org>.
On Tue, 2006-01-24 at 16:26 -0800, John wrote:
> I'm having incredible difficulty getting a managed bean to be
> instantiated.
>  
> -- I've gone to a very simple JavaBean for testing.
>  
> -- The managed bean XML is in faces-config.xml
>  
> -- I'm using Tobago
>  
> -- I'm using Tomcat 5.9 embedded within our application.
>  
> The beans constructor never gets called, although the JSF page
> displays fine (except of course the beans values aren't displayed).
>  
> No errors.

A managed bean is only instantiated when some expression that refers to
it is evaluated.

If you have a bean "myBean", and the page you load doesn't refer to it,
then the bean will not be created.

If the page does refer to it (eg via "#{mybean.name}") and the bean
can't be instantiated then a big exception will be thrown and you will
*definitely* not get the JSF page displayed fine.

Regards,

Simon