You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Stefan Gesigora <SG...@Software-architekten.de> on 2005/08/31 10:53:47 UTC

best way to initialize BackingBean?

 

Hi folks!

 

What is the best way to initialize BackingBeans?

I would like to get data from a DB everytime before the jsp will be
shown initializing the jsp with this data.

I can't use the constructor initialization cause I need it everytime not
only the first time.

I can't use initialization via managed-property cause the data isn't
static...

 

Any suggestions?

 

Thx 

Stefan Gesigora

 


Re: best way to initialize BackingBean?

Posted by Sean Schofield <se...@gmail.com>.
I'm using Shale for this.  This is one of the specific things that
Shale is designed to give you.  And yes, you can use with either the
RI or MyFaces (basically any JSF implementation.)  I use it with
MyFaces of course ;-)

There is a nice overview on the Struts website now
(http://struts.apache.org/shale.)  Check out the javadocs as well
since there is some good summary documentation in there as well.

sean

On 8/31/05, Jeff Cooper <js...@gmail.com> wrote:
> I'm new to JSF, so maybe this isn't best way.  But couldn't you do that from
> the action that sends you to the page you want to initialize.  Have your
> action mapped to the method you want to use as initilization method, then
> forward to the page. 
> 
>  
> On 8/31/05, Stefan Gesigora
> <SG...@software-architekten.de> wrote: 
> > 
> > 
> > 
> >   
> > 
> > Hi folks! 
> > 
> >   
> > 
> > What is the best way to initialize BackingBeans? 
> > 
> > I would like to get data from a DB everytime before the jsp will be shown
> initializing the jsp with this data. 
> > 
> > I can't use the constructor initialization cause I need it everytime not
> only the first time. 
> > 
> > I can't use initialization via managed-property cause the data isn't
> static… 
> > 
> >   
> > 
> > Any suggestions? 
> > 
> >   
> > 
> > Thx 
> > 
> > Stefan Gesigora 
> > 
> >  
> 
>

Re: best way to initialize BackingBean?

Posted by Jeff Cooper <js...@gmail.com>.
I'm new to JSF, so maybe this isn't best way. But couldn't you do that from 
the action that sends you to the page you want to initialize. Have your 
action mapped to the method you want to use as initilization method, then 
forward to the page.

On 8/31/05, Stefan Gesigora <SG...@software-architekten.de> wrote: 
> 
>   Hi folks!
> 
>  What is the best way to initialize BackingBeans?
> 
> I would like to get data from a DB everytime before the jsp will be shown 
> initializing the jsp with this data.
> 
> I can't use the constructor initialization cause I need it everytime not 
> only the first time.
> 
> I can't use initialization via managed-property cause the data isn't 
> static…
> 
>  Any suggestions?
> 
>  Thx 
> 
> Stefan Gesigora
> 
>

Re: best way to initialize BackingBean?

Posted by Martin Marinschek <ma...@gmail.com>.
You might use Shale to do this kind of things.

With Shale, if your beans implement a special interface, several
methods will be called on your bean - one of them before the view is
shown...

regards,

Martin

On 8/31/05, Stefan Gesigora <SG...@software-architekten.de> wrote:
>  
>  
> 
>   
> 
> Hi folks! 
> 
>   
> 
> What is the best way to initialize BackingBeans? 
> 
> I would like to get data from a DB everytime before the jsp will be shown
> initializing the jsp with this data. 
> 
> I can't use the constructor initialization cause I need it everytime not
> only the first time. 
> 
> I can't use initialization via managed-property cause the data isn't static…
> 
>   
> 
> Any suggestions? 
> 
>   
> 
> Thx 
> 
> Stefan Gesigora 
> 
>   


-- 

http://www.irian.at
Your JSF powerhouse - 
JSF Trainings in English and German