myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Kitching <simon.kitch...@rhe.co.nz>
Subject Re: Managed-bean vs. Backing-beans
Date Sun, 17 Dec 2006 22:49:37 GMT
Is the term "backing bean" actually used in the spec?

Simon Lessard wrote:
> Actually Core Java Server Faces uses backing bean when you use binding 
> attribute on tags. The backing bean is then the bean holding the 
> UIComponent reference.
> 
> 
> Regards,
> 
> ~ Simon
> 
> On 12/17/06, *Simon Kitching* <simon.kitching@rhe.co.nz 
> <mailto:simon.kitching@rhe.co.nz>> wrote:
> 
>     Behrang Saeedzadeh wrote:
>      > Hi,
>      >
>      > What is the difference between a managed-bean and a backing-bean?
>      >
>      > 1) Aren't all backing-beans, managed-beans as well?
>      > 2) In which scenarios a managed-bean is not a backing-bean?
>      >
>      > I browsed through the JSF 1.1 spec and I couldn't find the definition
>      > for either of these terms. Overall I think the spec lacks a glossary
>      > (local value, etc. are not defined formally anywhere in the sepc.)
> 
>     A "managed bean" is something defined in a faces config file using the
>     <managed-bean> tag.
> 
>     AFAIK, the term "backing bean" is not a term used by the JSF spec at
>     all. It's a common web development term (struts, etc) that doesn't
>     entirely map to the JSF concepts. My personal interpretation is that
>     when a page (jsp/facelets/etc) contains EL expressions that mostly or
>     entirely map onto a single managed bean, then that managed bean can be
>     called the "backing bean" for that page. Note, however, that there is no
>     requirement in JSF for a page to access only one managed bean; it can
>     access a dozen if it wishes, in which case the term "backing bean"
>     really can't be applied.
> 
>     And if I were using the Apache Shale View Controller, then I might use
>     the term "backing bean" to talk about the object that receives the
>     view-based callbacks, even if the associated page accesses a range of
>     other managed beans.
> 
>     Cheers,
> 
>     Simon
> 
> 


Mime
View raw message