You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shale.apache.org by JS Portal support team <su...@jsportal.com> on 2007/01/13 09:14:28 UTC

How to pass object between backing beans

Hi,

I have a view (myfiles.jsp) plus backing bean (myfiles). myfiles.jsp has
an jsp:include (filestable.jsp) in an s:subview which is backed by my
generictable bean. How can I best pass the List of file Objects from
myfiles to generictable. Something like <jsp:param name=”fileList”
value=”#{myfiles.files}”> would be great.

Or is this not the right way to setup my architecture?

Thank you


Re: How to pass object between backing beans

Posted by Craig McClanahan <cr...@apache.org>.
On 1/14/07, JS Portal Support <su...@jsportal.com> wrote:
>
> By the sounds of it jMaki is the way to go then. I understand you might be
> a
> bit bias here, but if it does whatever DOJO does and more, capturing all
> frameworks, what would be the reason for choosing any other framework?


"Whatever DOJO does and more" is not quite right ... jMaki doesn't currently
cover all of DOJO (or any of the other frameworks), and like any abstraction
layer its simplifications sometimes hide some of the capabilities of the
underlying widgets.  On the other hand, the ability to mix and match widgets
from different libraries is pretty handy if you need it.

Which is right for you?  Don't know ... that's really your call, depending
on your requirements :-).  The best thing to do would ge articulate the
kinds of capabilities you need, and see if there is a widget library that
addresses all of those needs directly.  If there is, you might want to look
at just using that library directly.  On the other hand, if you really need
multiple libraries, or you like the simplifications that jMaki provides, it
can be useful.

I agree with Kito's comments about how the existing jMaki JSF integration is
not particularly in the style of other JSF components.  I'm doing some work
in the jMaki project (contributions welcome ... it's open source) to provide
a more "traditional" style JSF component library that uses jMaki to do all
the rendering grunt work, but provides a component-per-widget environment
that JSF based developers will be familiar with.  It might be worth taking a
look at that, although it's in its early stages (six widgets wrapped so
far).

Cheers,
> Joost


Craig


-----Original Message-----
> From: craigmcc@gmail.com [mailto:craigmcc@gmail.com] On Behalf Of Craig
> McClanahan
> Sent: Monday, January 15, 2007 3:29 PM
> To: user@shale.apache.org
> Subject: Re: How to pass object between backing beans
>
> On 1/14/07, JS Portal Support <su...@jsportal.com> wrote:
> >
> > Craig,
> >
> > Great, it now works nicely and is portable to any other view I might
> > create
> > in the future without altering my GenericTable view.
>
>
> Cool ... that's the way it's supposed to work :-).
>
>
> On a different note:
> > Is it correct btw that MyFaces will use DOJO AJAX toolkit as its script
> > engine of choice? As we are currently looking at our options it seems to
> > me
> > this will be the wisest choice right?
>
>
> More specifically, the component libraries at MyFaces (Tomahawk and Tobago
> in the MyFaces project now, Trinidad in the incutabor) have tended to
> choose
> Dojo for their Ajax support.  That's more up to each individual library
> than
> it is up to MyFaces as a whole.  And, as a general policy, I can't
> disagree
> that it is a reasonable choice.  I used Dojo also in our work on the
> Blueprints Ajax components[1] that ship with Java Studio Creator and
> NetBeans Visual Web Pack.
>
> We made that choice originally because of the nice lower level APIs for
> asynchronous messaging and eventing on the client side.  I've been pretty
> happy with those layers, but not quite as happy with the UI widget layer
> --
> which has been going through a lot of evolution lately but is looking more
> settled as we go on.
>
> Personally, I'm spending a bunch of time today on the jMaki project[2],
> where a primary goal is to let you avoid locking yourself into one
> particular widget framework.  jMaki strives to provide a common adapter
> API
> around various widget libraries (including Dojo, Spry, Scriptaculous,
> Yahoo,
> and a bunch of others) to both reduce complexity and support
> mix-and-match.
> Today, there's a low level JSF component that provides direct connection
> to
> a large portion of these libraries, but with a fairly low level API.  I'm
> also working on adding a layer of JSF components per widget that will
> appeal
> more to someone familiar with traditional JSF composition of your views
> ...
> and, will fit very nicely into visual development tools.
>
> Needless to say, this all works very nicely with Shale :-).
>
> I have to say the more I learn about shale/MyFaces the more excited I get.
> > We come from a custom build mvc which we respectfully will lay to rest
> now
> > :-)
>
>
> :-)
>
> Thanks,
> > Joost
>
>
> Craig
>
>

RE: How to pass object between backing beans

Posted by "Kito D. Mann" <km...@virtua.com>.
> -----Original Message-----
> From: JS Portal Support [mailto:support@jsportal.com] 
> Sent: Monday, January 15, 2007 2:43 AM
> To: user@shale.apache.org
> Subject: RE: How to pass object between backing beans
> 
> By the sounds of it jMaki is the way to go then. I understand 
> you might be a bit bias here, but if it does whatever DOJO 
> does and more, capturing all frameworks, what would be the 
> reason for choosing any other framework?

Well, jMaki's built-in JSF support is pretty limited -- it has a generic
component that isn't particularly JSF-friendly or easy to use. It also
doesn't integrate well with server-side data models. According to Craig,
he's working on changing this, so the situation may change soon.

I tend to prefer JSF components that hava AJAX functionality -- they
integrate much better with JSF applications in my opinion.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann (kmann@virtua.com)
Author, JavaServer Faces in Action
http://www.virtua.com - JSF/Java EE consulting, training, and mentoring
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info

> 
> -----Original Message-----
> From: craigmcc@gmail.com [mailto:craigmcc@gmail.com] On 
> Behalf Of Craig McClanahan
> Sent: Monday, January 15, 2007 3:29 PM
> To: user@shale.apache.org
> Subject: Re: How to pass object between backing beans
> 
> On 1/14/07, JS Portal Support <su...@jsportal.com> wrote:
> >
> > Craig,
> >
> > Great, it now works nicely and is portable to any other 
> view I might 
> > create in the future without altering my GenericTable view.
> 
> 
> Cool ... that's the way it's supposed to work :-).
> 
> 
> On a different note:
> > Is it correct btw that MyFaces will use DOJO AJAX toolkit 
> as its script
> > engine of choice? As we are currently looking at our 
> options it seems to
> > me
> > this will be the wisest choice right?
> 
> 
> More specifically, the component libraries at MyFaces 
> (Tomahawk and Tobago
> in the MyFaces project now, Trinidad in the incutabor) have 
> tended to choose
> Dojo for their Ajax support.  That's more up to each 
> individual library than
> it is up to MyFaces as a whole.  And, as a general policy, I 
> can't disagree
> that it is a reasonable choice.  I used Dojo also in our work on the
> Blueprints Ajax components[1] that ship with Java Studio Creator and
> NetBeans Visual Web Pack.
> 
> We made that choice originally because of the nice lower 
> level APIs for
> asynchronous messaging and eventing on the client side.  I've 
> been pretty
> happy with those layers, but not quite as happy with the UI 
> widget layer --
> which has been going through a lot of evolution lately but is 
> looking more
> settled as we go on.
> 
> Personally, I'm spending a bunch of time today on the jMaki 
> project[2],
> where a primary goal is to let you avoid locking yourself into one
> particular widget framework.  jMaki strives to provide a 
> common adapter API
> around various widget libraries (including Dojo, Spry, 
> Scriptaculous, Yahoo,
> and a bunch of others) to both reduce complexity and support 
> mix-and-match.
> Today, there's a low level JSF component that provides direct 
> connection to
> a large portion of these libraries, but with a fairly low 
> level API.  I'm
> also working on adding a layer of JSF components per widget 
> that will appeal
> more to someone familiar with traditional JSF composition of 
> your views ...
> and, will fit very nicely into visual development tools.
> 
> Needless to say, this all works very nicely with Shale :-).
> 
> I have to say the more I learn about shale/MyFaces the more 
> excited I get.
> > We come from a custom build mvc which we respectfully will 
> lay to rest now
> > :-)
> 
> 
> :-)
> 
> Thanks,
> > Joost
> 
> 
> Craig
> 


RE: How to pass object between backing beans

Posted by JS Portal Support <su...@jsportal.com>.
By the sounds of it jMaki is the way to go then. I understand you might be a
bit bias here, but if it does whatever DOJO does and more, capturing all
frameworks, what would be the reason for choosing any other framework?

Cheers,
Joost

-----Original Message-----
From: craigmcc@gmail.com [mailto:craigmcc@gmail.com] On Behalf Of Craig
McClanahan
Sent: Monday, January 15, 2007 3:29 PM
To: user@shale.apache.org
Subject: Re: How to pass object between backing beans

On 1/14/07, JS Portal Support <su...@jsportal.com> wrote:
>
> Craig,
>
> Great, it now works nicely and is portable to any other view I might
> create
> in the future without altering my GenericTable view.


Cool ... that's the way it's supposed to work :-).


On a different note:
> Is it correct btw that MyFaces will use DOJO AJAX toolkit as its script
> engine of choice? As we are currently looking at our options it seems to
> me
> this will be the wisest choice right?


More specifically, the component libraries at MyFaces (Tomahawk and Tobago
in the MyFaces project now, Trinidad in the incutabor) have tended to choose
Dojo for their Ajax support.  That's more up to each individual library than
it is up to MyFaces as a whole.  And, as a general policy, I can't disagree
that it is a reasonable choice.  I used Dojo also in our work on the
Blueprints Ajax components[1] that ship with Java Studio Creator and
NetBeans Visual Web Pack.

We made that choice originally because of the nice lower level APIs for
asynchronous messaging and eventing on the client side.  I've been pretty
happy with those layers, but not quite as happy with the UI widget layer --
which has been going through a lot of evolution lately but is looking more
settled as we go on.

Personally, I'm spending a bunch of time today on the jMaki project[2],
where a primary goal is to let you avoid locking yourself into one
particular widget framework.  jMaki strives to provide a common adapter API
around various widget libraries (including Dojo, Spry, Scriptaculous, Yahoo,
and a bunch of others) to both reduce complexity and support mix-and-match.
Today, there's a low level JSF component that provides direct connection to
a large portion of these libraries, but with a fairly low level API.  I'm
also working on adding a layer of JSF components per widget that will appeal
more to someone familiar with traditional JSF composition of your views ...
and, will fit very nicely into visual development tools.

Needless to say, this all works very nicely with Shale :-).

I have to say the more I learn about shale/MyFaces the more excited I get.
> We come from a custom build mvc which we respectfully will lay to rest now
> :-)


:-)

Thanks,
> Joost


Craig


[OT] jMaki, Dojo, and AJAX integration (was RE: How to pass object between backing beans)

Posted by "Kito D. Mann" <km...@virtua.com>.
Craig,

I was talking to Greg Murray about jMaki at Javapolis, and I mentioned the
possibility of generating JSF components based on some metadata much like
the RI and MyFaces do for the HTML components and the tag libraries. (I
don't think Greg fully appreciates the value of the JSF model.) Are you
taking a code-generation approach or more of a hand-crafted approach?

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kito D. Mann - Author, JavaServer Faces in Action
http://www.JSFCentral.com - JavaServer Faces FAQ, news, and info

* Sign up for the JSF Central newsletter!
http://oi.vresp.com/?fid=ac048d0e17 *



 

> -----Original Message-----
> From: craigmcc@gmail.com [mailto:craigmcc@gmail.com] On 
> Behalf Of Craig McClanahan
> Sent: Sunday, January 14, 2007 9:29 PM
> To: user@shale.apache.org
> Subject: Re: How to pass object between backing beans
> 
> On 1/14/07, JS Portal Support <su...@jsportal.com> wrote:
> >
> > Craig,
> >
> > Great, it now works nicely and is portable to any other 
> view I might 
> > create in the future without altering my GenericTable view.
> 
> 
> Cool ... that's the way it's supposed to work :-).
> 
> 
> On a different note:
> > Is it correct btw that MyFaces will use DOJO AJAX toolkit 
> as its script
> > engine of choice? As we are currently looking at our 
> options it seems to
> > me
> > this will be the wisest choice right?
> 
> 
> More specifically, the component libraries at MyFaces 
> (Tomahawk and Tobago
> in the MyFaces project now, Trinidad in the incutabor) have 
> tended to choose
> Dojo for their Ajax support.  That's more up to each 
> individual library than
> it is up to MyFaces as a whole.  And, as a general policy, I 
> can't disagree
> that it is a reasonable choice.  I used Dojo also in our work on the
> Blueprints Ajax components[1] that ship with Java Studio Creator and
> NetBeans Visual Web Pack.
> 
> We made that choice originally because of the nice lower 
> level APIs for
> asynchronous messaging and eventing on the client side.  I've 
> been pretty
> happy with those layers, but not quite as happy with the UI 
> widget layer --
> which has been going through a lot of evolution lately but is 
> looking more
> settled as we go on.
> 
> Personally, I'm spending a bunch of time today on the jMaki 
> project[2],
> where a primary goal is to let you avoid locking yourself into one
> particular widget framework.  jMaki strives to provide a 
> common adapter API
> around various widget libraries (including Dojo, Spry, 
> Scriptaculous, Yahoo,
> and a bunch of others) to both reduce complexity and support 
> mix-and-match.
> Today, there's a low level JSF component that provides direct 
> connection to
> a large portion of these libraries, but with a fairly low 
> level API.  I'm
> also working on adding a layer of JSF components per widget 
> that will appeal
> more to someone familiar with traditional JSF composition of 
> your views ...
> and, will fit very nicely into visual development tools.
> 
> Needless to say, this all works very nicely with Shale :-).
> 
> I have to say the more I learn about shale/MyFaces the more 
> excited I get.
> > We come from a custom build mvc which we respectfully will 
> lay to rest now
> > :-)
> 
> 
> :-)
> 
> Thanks,
> > Joost
> 
> 
> Craig
> 


Re: How to pass object between backing beans

Posted by Craig McClanahan <cr...@apache.org>.
It pays to add the footnotes:

[1] https://bpcatalog.dev.java.net/
[2] https://ajax.dev.java.net/

Craig

On 1/14/07, Craig McClanahan <cr...@apache.org> wrote:
>
>
>
> On 1/14/07, JS Portal Support <su...@jsportal.com> wrote:
> >
> > Craig,
> >
> > Great, it now works nicely and is portable to any other view I might
> > create
> > in the future without altering my GenericTable view.
>
>
> Cool ... that's the way it's supposed to work :-).
>
>
> On a different note:
> > Is it correct btw that MyFaces will use DOJO AJAX toolkit as its script
> > engine of choice? As we are currently looking at our options it seems to
> > me
> > this will be the wisest choice right?
>
>
> More specifically, the component libraries at MyFaces (Tomahawk and Tobago
> in the MyFaces project now, Trinidad in the incutabor) have tended to choose
> Dojo for their Ajax support.  That's more up to each individual library than
> it is up to MyFaces as a whole.  And, as a general policy, I can't disagree
> that it is a reasonable choice.  I used Dojo also in our work on the
> Blueprints Ajax components[1] that ship with Java Studio Creator and
> NetBeans Visual Web Pack.
>
> We made that choice originally because of the nice lower level APIs for
> asynchronous messaging and eventing on the client side.  I've been pretty
> happy with those layers, but not quite as happy with the UI widget layer --
> which has been going through a lot of evolution lately but is looking more
> settled as we go on.
>
> Personally, I'm spending a bunch of time today on the jMaki project[2],
> where a primary goal is to let you avoid locking yourself into one
> particular widget framework.  jMaki strives to provide a common adapter API
> around various widget libraries (including Dojo, Spry, Scriptaculous, Yahoo,
> and a bunch of others) to both reduce complexity and support mix-and-match.
> Today, there's a low level JSF component that provides direct connection to
> a large portion of these libraries, but with a fairly low level API.  I'm
> also working on adding a layer of JSF components per widget that will appeal
> more to someone familiar with traditional JSF composition of your views ...
> and, will fit very nicely into visual development tools.
>
> Needless to say, this all works very nicely with Shale :-).
>
> I have to say the more I learn about shale/MyFaces the more excited I get.
> >
> > We come from a custom build mvc which we respectfully will lay to rest
> > now
> > :-)
>
>
> :-)
>
> Thanks,
> > Joost
>
>
> Craig
>
>

Re: How to pass object between backing beans

Posted by Craig McClanahan <cr...@apache.org>.
On 1/14/07, JS Portal Support <su...@jsportal.com> wrote:
>
> Craig,
>
> Great, it now works nicely and is portable to any other view I might
> create
> in the future without altering my GenericTable view.


Cool ... that's the way it's supposed to work :-).


On a different note:
> Is it correct btw that MyFaces will use DOJO AJAX toolkit as its script
> engine of choice? As we are currently looking at our options it seems to
> me
> this will be the wisest choice right?


More specifically, the component libraries at MyFaces (Tomahawk and Tobago
in the MyFaces project now, Trinidad in the incutabor) have tended to choose
Dojo for their Ajax support.  That's more up to each individual library than
it is up to MyFaces as a whole.  And, as a general policy, I can't disagree
that it is a reasonable choice.  I used Dojo also in our work on the
Blueprints Ajax components[1] that ship with Java Studio Creator and
NetBeans Visual Web Pack.

We made that choice originally because of the nice lower level APIs for
asynchronous messaging and eventing on the client side.  I've been pretty
happy with those layers, but not quite as happy with the UI widget layer --
which has been going through a lot of evolution lately but is looking more
settled as we go on.

Personally, I'm spending a bunch of time today on the jMaki project[2],
where a primary goal is to let you avoid locking yourself into one
particular widget framework.  jMaki strives to provide a common adapter API
around various widget libraries (including Dojo, Spry, Scriptaculous, Yahoo,
and a bunch of others) to both reduce complexity and support mix-and-match.
Today, there's a low level JSF component that provides direct connection to
a large portion of these libraries, but with a fairly low level API.  I'm
also working on adding a layer of JSF components per widget that will appeal
more to someone familiar with traditional JSF composition of your views ...
and, will fit very nicely into visual development tools.

Needless to say, this all works very nicely with Shale :-).

I have to say the more I learn about shale/MyFaces the more excited I get.
> We come from a custom build mvc which we respectfully will lay to rest now
> :-)


:-)

Thanks,
> Joost


Craig

RE: How to pass object between backing beans

Posted by JS Portal Support <su...@jsportal.com>.
Craig,

Great, it now works nicely and is portable to any other view I might create
in the future without altering my GenericTable view.

On a different note:
Is it correct btw that MyFaces will use DOJO AJAX toolkit as its script
engine of choice? As we are currently looking at our options it seems to me
this will be the wisest choice right?

I have to say the more I learn about shale/MyFaces the more excited I get.
We come from a custom build mvc which we respectfully will lay to rest now
:-)

Thanks,
Joost

-----Original Message-----
From: craigmcc@gmail.com [mailto:craigmcc@gmail.com] On Behalf Of Craig
McClanahan
Sent: Monday, January 15, 2007 12:24 PM
To: user@shale.apache.org
Subject: Re: How to pass object between backing beans

On 1/13/07, JS Portal Support <su...@jsportal.com> wrote:
>
> Thanks Craig,
>
> That makes sense. But the problem here is that generictable will be called
> from many views, and not just the myfiles view. So I would love the
> injection to be handled from the myfiles view, backing bean or
> managed-bean
> declaration. Is this possible?


In this case, doing an injection from the view wouldn't work anyway, right?

Fortunately, since it's your controller that knows what view it is going to
navigate to, it can do the injection programmatically.  There's two
different possible techniques:

Using standard JSF APIs, programmatically evaluate an EL expression like
this:

    FacesContext context = FacesContext.getCurrentInstance();
    ValueBinding vb = context.getApplication().createValueBinding("#{
generictable.fileList}");
    vb.setValue(context, ... the list to be injected ...);

or, if you are extending AbstractViewController, you can take advantage of a
helper method:

    GenericTable gt = getBean("generictable");
    gt.setFileList(... the list to be injected ...);

So basically I want my s:view to pass instantiated objects to its
> s:subview's


For this particular scenario, putting the injection code into the prerender
method of the outer view should do the trick.  That's the same place you
would go grab data that you might need for the outer view itself, so it's
nicely consistent when using subviews.

Thanks,
> Joost


Craig


Re: How to pass object between backing beans

Posted by Craig McClanahan <cr...@apache.org>.
On 1/13/07, JS Portal Support <su...@jsportal.com> wrote:
>
> Thanks Craig,
>
> That makes sense. But the problem here is that generictable will be called
> from many views, and not just the myfiles view. So I would love the
> injection to be handled from the myfiles view, backing bean or
> managed-bean
> declaration. Is this possible?


In this case, doing an injection from the view wouldn't work anyway, right?

Fortunately, since it's your controller that knows what view it is going to
navigate to, it can do the injection programmatically.  There's two
different possible techniques:

Using standard JSF APIs, programmatically evaluate an EL expression like
this:

    FacesContext context = FacesContext.getCurrentInstance();
    ValueBinding vb = context.getApplication().createValueBinding("#{
generictable.fileList}");
    vb.setValue(context, ... the list to be injected ...);

or, if you are extending AbstractViewController, you can take advantage of a
helper method:

    GenericTable gt = getBean("generictable");
    gt.setFileList(... the list to be injected ...);

So basically I want my s:view to pass instantiated objects to its
> s:subview's


For this particular scenario, putting the injection code into the prerender
method of the outer view should do the trick.  That's the same place you
would go grab data that you might need for the outer view itself, so it's
nicely consistent when using subviews.

Thanks,
> Joost


Craig

RE: How to pass object between backing beans

Posted by JS Portal Support <su...@jsportal.com>.
Thanks Craig,

That makes sense. But the problem here is that generictable will be called
from many views, and not just the myfiles view. So I would love the
injection to be handled from the myfiles view, backing bean or managed-bean
declaration. Is this possible?

So basically I want my s:view to pass instantiated objects to its
s:subview's

Thanks,
Joost 

JS Portal - Support
Dasstraat 21
2623CB Delft
the Netherlands
E: support@jsportal.com
W: www.jsportal.com 
-----Original Message-----
From: craigmcc@gmail.com [mailto:craigmcc@gmail.com] On Behalf Of Craig
McClanahan
Sent: Sunday, January 14, 2007 1:08 PM
To: user@shale.apache.org
Subject: Re: How to pass object between backing beans

On 1/13/07, JS Portal support team <su...@jsportal.com> wrote:
>
> Hi,
>
> I have a view (myfiles.jsp) plus backing bean (myfiles). myfiles.jsp has
> an jsp:include (filestable.jsp) in an s:subview which is backed by my
> generictable bean. How can I best pass the List of file Objects from
> myfiles to generictable. Something like <jsp:param name="fileList"
> value="#{myfiles.files}"> would be great.
>
> Or is this not the right way to setup my architecture?


As a matter of fact, something very similar to this is available ... but
it's done in the managed bean definition instead of in the view:

    <managed-bean>
        <managed-bean-name>generictable</managed-bean-name>
        <managed-bean-class>...</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
            <property-name>fileList</property-name>
            <value>#{myfiles.files}</value>
        </managed-property>
    </managed-bean>

The expression will be evaluated when this managed bean is created, and
setFileList() will be called with the result.

This general technique is known as dependency injection, and JSF supports
the variant called "setter injection" which (as the name implies) uses
property setters to actually insert the values.  The only restriction on
what kind of expressions you can evaluate are that you cannot inject a value
from a shorter scope (such as request) into a bean in a longer scope
(session or application).  The other way around (longer-scoped bean into
shorter-scoped bean property), or the same scope, is fine.

Thank you
>
>
Craig


Re: How to pass object between backing beans

Posted by Craig McClanahan <cr...@apache.org>.
On 1/13/07, JS Portal support team <su...@jsportal.com> wrote:
>
> Hi,
>
> I have a view (myfiles.jsp) plus backing bean (myfiles). myfiles.jsp has
> an jsp:include (filestable.jsp) in an s:subview which is backed by my
> generictable bean. How can I best pass the List of file Objects from
> myfiles to generictable. Something like <jsp:param name="fileList"
> value="#{myfiles.files}"> would be great.
>
> Or is this not the right way to setup my architecture?


As a matter of fact, something very similar to this is available ... but
it's done in the managed bean definition instead of in the view:

    <managed-bean>
        <managed-bean-name>generictable</managed-bean-name>
        <managed-bean-class>...</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
            <property-name>fileList</property-name>
            <value>#{myfiles.files}</value>
        </managed-property>
    </managed-bean>

The expression will be evaluated when this managed bean is created, and
setFileList() will be called with the result.

This general technique is known as dependency injection, and JSF supports
the variant called "setter injection" which (as the name implies) uses
property setters to actually insert the values.  The only restriction on
what kind of expressions you can evaluate are that you cannot inject a value
from a shorter scope (such as request) into a bean in a longer scope
(session or application).  The other way around (longer-scoped bean into
shorter-scoped bean property), or the same scope, is fine.

Thank you
>
>
Craig