On Tue, 2006-01-24 at 20:50 -0800, John wrote:
> Yes. Exactly. That is my understanding of how it "should" work also.

Then you need to re-read your original posting, because something
doesn't add up.

If the managed bean is referenced, and cannot be created, then you
*will* get an exception. However you claim that (a) it is referenced,
(b) it isn't created, and (c) you don't get an exception. At least one
of these statements must be incorrect.

If you can't figure out which of a,b,c isn't true then I suggest posting
the relevant JSP fragments, faces-config.xml fragments and the bits of
code you are using to check whether the managed bean was created or not.
Also please indicate which version of MyFaces you are using.

Managed beans do work; there would be more than a few people noticing if
they didn't!

Regards, 

Simon

> 
> John 
> 
> -----Original Message-----
> From: Simon Kitching [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, January 24, 2006 7:48 PM
> To: MyFaces Discussion
> Subject: Re: Managed beans not being instantiated
> 
> 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
> 
> 
> 

Reply via email to