You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Yu...@muranosoft.com on 2006/03/27 15:01:10 UTC

JSF application

Hi, All

 

I have a problem and want to know your advises about this. 

I have a page with request managed bean and this bean have property which
referenced to session scope bean. When I need to initialize my page with
default values with session scope beans I always do this in default
constructor of my managed bean, but with request scope bean this property to
session bean will be null. I suppose that this property initialize by
FacesContext after instance of request scope bean have been created.

 

So how I can implement initialization of my page with request scope bean?

 

Thanks for any of your help,

Yura.


RE: JSF application

Posted by Yee CN <ye...@streamyx.com>.
You can create a property called setInit() in your bean, then

 

            public void setInit(boolean dummy) {

                        // your initialization code

            }

 

Then in your faces-config.xml you provide a dummy "true" to this property.
This should appear last, as you would probably want to have all other
properties set before you do your initialization stuff. JSF guarantees that
the properties will be set in the order in which they appear in
faces-config.xml

 

Regards,

Yee

  _____  

From: Yura.Tkachenko@muranosoft.com [mailto:Yura.Tkachenko@muranosoft.com] 
Sent: Monday, 27 March 2006 9:01 PM
To: users@myfaces.apache.org
Subject: JSF application

 

Hi, All

 

I have a problem and want to know your advises about this. 

I have a page with request managed bean and this bean have property which
referenced to session scope bean. When I need to initialize my page with
default values with session scope beans I always do this in default
constructor of my managed bean, but with request scope bean this property to
session bean will be null. I suppose that this property initialize by
FacesContext after instance of request scope bean have been created.

 

So how I can implement initialization of my page with request scope bean?

 

Thanks for any of your help,

Yura.