On Mon, 20 Sep 2004 08:41:55 -0600, BaTien Duong <[EMAIL PROTECTED]> wrote: > > Just 2 quick questions from expert advise. Assuming FooBean is > initialized by Faces in the session:
> 1) Under what cirscunstances we shoud use Faces or directly > accessing the component under user session, assuming that you also use > faces with other framework such as Tiles? I'm not quite sure what you are referring to, but it's quite straightforward to reference properties from a session-scoped bean. For example, assume "user" is a UserProfileBean and has a name property. You can use expressions like this: Hello <h:outputText value="#{user.name}"/> Note that it doesn't matter whether the bean was created by the managed beans facility or via programmatic logic (say, being placed there by an Action), so it is very straightforward to interoperate. > 2) If FooBean is a default user profile bean, does faces have some > kind of caching so it can just replicate the default configuration of > the user profile for every created user session? If the caching is not a > part of spec then which implementation (RI or myfaces) has it? You can specify initial values for the properties of a managed bean by using <managed-property> elements nested inside: <managed-bean> <managed-bean-name>user</managedp-bean-name> <managed-bean-class>com.mycompany.UserProfileBean</managed-bean-class> <managed-bean-scope>session</managed-bean-scope> <managed-property> <property-name>userType</property-name> <property-class>java.lang.String</property-class> <value>Standard</value> </managed-property> </managed-bean> The content of the <value> element can be either a literal value or a value binding expression, so you can have your initialization grab dynamically calculated values if you need them. Craig --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]