Whem Myfaces loads, it unmarshalls the faces configurations file(s) into an 
object model.  It stores this in application scope, check the source in order 
to find out which attribute key this is, I forget.  You can also just create 
your own.

FacesConfigUnmarshaller _unmarshaller = new 
DigesterFacesConfigUnmarshallerImpl(null);
InputStream is = new FileInputStream(new File(pathToFacesConfig));
FacesConfigDispenser dispenser = new DigesterFacesConfigDispenserImpl();
dispenser.feed(_unmarshaller.getFacesConfig(is, path));

This of course is vendor lock-in.

Dennis Byrne

>-----Original Message-----
>From: Yogesh Chaudhari [mailto:[EMAIL PROTECTED]
>Sent: Saturday, February 4, 2006 05:08 PM
>To: 'MyFaces Discussion'
>Subject: How I can read managed property value from faces-config file in class 
>constructor?
>
>Hi,
>
>I would like to read "show" managed property value in InvoiceBean
>class constructor so I can populate different resultset in "invoices"
>arraylist to display on page.
>
>Thanks, Yogesh
>
>public class InvoiceBean {
>       private String show;
>       ArrayList invoices;
>
>       public InvoiceBean () {
>               System.out.println("show invoices " + show);    
>               invoices = getInvoices();
>       }
>
><faces-config>
>  <managed-bean>
>    <managed-bean-name>invoiceALLBean</managed-bean-name>
>    <managed-bean-class>org.adr.faces.backing.InvoiceBean</managed-bean-class>
>    <managed-bean-scope>request</managed-bean-scope>
>    <managed-property>
>      <property-name>show</property-name>
>      <property-class>java.lang.String</property-class>
>      <value>ALL</value>
>    </managed-property>
>  </managed-bean>
>
>  <managed-bean>
>    <managed-bean-name>invoicePENDINGBean</managed-bean-name>
>    <managed-bean-class>org.adr.faces.backing.InvoiceBean</managed-bean-class>
>    <managed-bean-scope>request</managed-bean-scope>
>    <managed-property>
>      <property-name>show</property-name>
>      <property-class>java.lang.String</property-class>
>      <value>PENDING</value>
>    </managed-property>
>  </managed-bean>
>.
>.
>.
></faces-config>
>


Reply via email to