The Managed Bean in the faces-config.xml File

I am still very new to JSF. I am confused about the managed bean.
For example, I have a button in my web page. A click on this button invokes an action; say, ListAction.java.
In this ListAction class, I instantiate a business delegate; say, ListPersonnel.java and call a method in this business delegate to return an ArrayList: personnel. Of course, this business delegate goes through facade, DAO, etc. to populate the ArrayList. This ArrayList is a collecation of a JavaBean called PersonnelBean that gets and sets a number of personnel information; such as ssn, name, etc.
Upon this ArrayList is successfully populated and received by the ListAction class, I am going to display a web page with a table. In JSF, it is <h:dataTable ...>.
My questions are regarding the managed bean in the faces-config.xml file.
1. Which one is my <managed-bean-class>? packageName.ListAction? or packageName.PersonnelBean? or something else?
2. What should be my <managed-bean-name>? I guess that I can give a name I like. Is it right? What about xyz?
3. Then, how do I specify the "value" attribute of my <h:dataTable ...> tag when I display a web page to show the data table? Is it correct to specify value="#{xyz.personnel}"? What is the correct specification if it is wrong?
4. I guess that I can give any name to the "var" attribute in the <h:dataTable ...> tag. Is it right?

1. Which one is my <managed-bean-class>?
packageName.ListAction? or
packageName.PersonnelBean? or something else?ListAction
2. What should be my <managed-bean-name>? I guess
that I can give a name I like. Is it right? What
about xyz?Anything you like. xyz is OK.
3. Then, how do I specify the "value" attribute of my
<h:dataTable ...> tag when I display a web page to
show the data table? Is it correct to specify
value="#{xyz.personnel}"? What is the correct
specification if it is wrong?xyz.personnel is OK assuming that ListAction class has a public
method getPersonnel() which returns the ArrayList of PersonnellBeans.
4. I guess that I can give any name to the "var"
attribute in the <h:dataTable ...> tag. Is it right?Yes, you can give any name you like.

Similar Messages

  • What belongs in the faces-config.xml file? Just bean and navigation info?

    I am looking for detailed information on the faces-config.xml file.
    I've used examples up to this point and I was wondering where the documentation for this configuration file was at.
    At this point, I know that bean management and navigation information is in this file, but are there other settings?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Pringi: The tag explantion information, why isn't that easily found on Sun's web site or document site?
    This has been the most frustrating part - finding pieces of information here and there... and not in one location.
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Managed bean in both adfc-config.xml and faces-config.xml file

    hi,
    i can see that it's possible to declare managed bean in both adfc-config.xml and faces-config.xml file.
    is there any difference? which one is recommended?
    read here - http://www.jaypillai.com/tag/adf/
    but still not clear.
    thanks.

    Hi.
    As you know ADF is a framework based on JSF.
    In faces-config.xml you define general application manage beans. It offers you define manage beans for all application using JSF default scopes (application, session, request).
    In adfc-config.xml you define general application manage beans using ADF Scopes. It means that you can use JSF default ones including "view, pageFlow and backing".
    My recommendation is use only one point entry for your general manage beans. Use adfc-config.xml because allow you to use more scopes.
    Regards.

  • Problem trying to save the faces-config.xml file (ADF BC)

    When I try to save this file, I get the following error:
    The application has tried to de-reference an invalid pointer. This exception should have been dealt with programmatically. The current activity may fail and the system may have been left in an unstable state. The following is a stack trace.
    java.lang.NullPointerException
         at oracle.bm.diagrammer.shape.BaseDiagramEdge.startMove(BaseDiagramEdge.java:2721)
         at oracle.bm.diagrammer.track.MoveTracker.<init>(MoveTracker.java:215)
         at oracle.bm.diagrammer.track.SelectionTracker.mousePressed(SelectionTracker.java:754)
         at oracle.bm.diagrammer.track.ModularTracker.processEvent(ModularTracker.java:191)
         at oracle.bm.diagrammer.track.SelectionTracker.processEvent(SelectionTracker.java:138)
         at oracle.bm.diagrammer.track.TrackerStack.processEvent(TrackerStack.java:389)
         at oracle.bm.diagrammer.BaseDiagramView$53.processEvent(BaseDiagramView.java:719)
         at oracle.bm.diagrammer.PageView$PageViewPanel.fireEvent(PageView.java:2904)
         at oracle.bm.diagrammer.PageView$PageViewPanel.processEvent(PageView.java:3090)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Also, a few of my navigations have the label of "!NLS Error"
    If anyone has any information to help me I would appreciate it, thank you.

    i replaced the "faces-config.oxd_faces" file. it is found under:
    C:\jdevadf\jdev\YourApplication\ViewController\model\public_html\WEB-INF
    if you have an older copy of this file, just replace it, your faces-config.xml file might get moved around, mine took me over an hour to rearrange my page flows but it did the trick.

  • Error message in adf-faces-config.xml file in myEclipse

    hello,
    i'm trying to customize appearance of my JSF/ADF Faces app (which worked fine until now), and tried to insert a adf-faces-config.xml file in my WEB-INF directory, this is it (copied from a tutorial) :
    <?xml version="1.0"?>
    <adf-faces-config xmlns="http://xmlns.oracle.com/adf/view/faces/config">
    <!-- Enable debug output -->
    <debug-output>true</debug-output>
    <!-- Pick accessibility options based on a per-user managed bean -->
    <accessibility-mode>#{user.accessibilityMode}</accessibility-mode>
    <!-- A silly use of EL: English users get one appearance, -->
    <!-- others get another -->
    <skin-family>
    #{view.locale.language=='en' ? 'minimal' : 'oracle'}
    </skin-family>
    </adf-faces-config>
    after saving the file (in myEclipse) i get the following error message on the second line :
    cvc-elt.1 : Cannot find the declaration of element 'adf-faces-config'
    what does that mean and what should i do ?
    thx...

    hello,
    i'm trying to customize appearance of my JSF/ADF
    Faces app (which worked fine until now), and tried to
    insert a adf-faces-config.xml file in my WEB-INF
    directory, this is it (copied from a tutorial) :
    <?xml version="1.0"?>
    <adf-faces-config
    xmlns="http://xmlns.oracle.com/adf/view/faces/config">
    <!-- Enable debug output -->
    <debug-output>true</debug-output>
    <!-- Pick accessibility options based on a per-user
    managed bean -->
    <accessibility-mode>#{user.accessibilityMode}</accessi
    bility-mode>
    <!-- A silly use of EL: English users get one
    appearance, -->
    <!-- others get another -->
    <skin-family>
    #{view.locale.language=='en' ? 'minimal' : 'oracle'}
    </skin-family>
    </adf-faces-config>
    after saving the file (in myEclipse) i get the
    following error message on the second line :
    cvc-elt.1 : Cannot find the declaration of element
    'adf-faces-config'
    what does that mean and what should i do ?
    thx...Hello again,
    i'm still stuck with this, could somebody PLEASE give me a hint ?
    thx,
    dom.

  • Error with adf-faces-config.xml file in myEclipse

    hello,
    i'm trying to customize appearance of my JSF/ADF Faces app (which worked fine until now), and tried to insert a adf-faces-config.xml file in my WEB-INF directory, this is it (copied from a tutorial) :
    <?xml version="1.0"?>
    <adf-faces-config xmlns="http://xmlns.oracle.com/adf/view/faces/config">
    <!-- Enable debug output -->
    <debug-output>true</debug-output>
    <!-- Pick accessibility options based on a per-user managed bean -->
    <accessibility-mode>#{user.accessibilityMode}</accessibility-mode>
    <!-- A silly use of EL: English users get one appearance, -->
    <!-- others get another -->
    <skin-family>
    #{view.locale.language=='en' ?  'minimal' : 'oracle'}
    </skin-family>
    </adf-faces-config>
    after saving the file (in myEclipse) i get the following error message on the second line :
    cvc-elt.1 : Cannot find the declaration of element 'adf-faces-config'
    what does that mean and what should i do ?
    thx...

    hello,
    i'm trying to customize appearance of my JSF/ADF
    Faces app (which worked fine until now), and tried to
    insert a adf-faces-config.xml file in my WEB-INF
    directory, this is it (copied from a tutorial) :
    <?xml version="1.0"?>
    <adf-faces-config
    xmlns="http://xmlns.oracle.com/adf/view/faces/config">
    <!-- Enable debug output -->
    <debug-output>true</debug-output>
    <!-- Pick accessibility options based on a per-user
    managed bean -->
    <accessibility-mode>#{user.accessibilityMode}</accessi
    bility-mode>
    <!-- A silly use of EL: English users get one
    appearance, -->
    <!-- others get another -->
    <skin-family>
    #{view.locale.language=='en' ? 'minimal' : 'oracle'}
    </skin-family>
    </adf-faces-config>
    after saving the file (in myEclipse) i get the
    following error message on the second line :
    cvc-elt.1 : Cannot find the declaration of element
    'adf-faces-config'
    what does that mean and what should i do ?
    thx...Hello again,
    i'm still stuck with this, could somebody PLEASE give me a hint ?
    thx,
    dom.

  • ADF faces-config.xml file

    Hi ADF gurus,
    I am new to this technology and i have found in oracle developer's guide that "Registering managed beans within the faces-config.xml file is not recommended in a Fusion web application".
    URL : http://docs.oracle.com/cd/E28271_01/web.1111/e28164/web_getstarted.htm#CACCFIII
    Section: Using a Managed Bean in a Fusion Web Application
    My question is why this?
    Thanks & Regards,
    Sharmistha

    If you plan to use the ADF stack there are some enhancements added to the normal faces lifecycle like bounded task flows, pageFlowScope and some additional phases the normal faces lifecaycle doesn't have. This additions are handled in the adcf-config.xml. If you register your beans in the facces-config file they are not managed by the adf stack and therefore can't use the additions.
    So Oracle encourage you to use the adfc-config.xml instead of the faces-config.xml. There are a few special entries which still needed to be made in the faces-config file (e.g. skinning), butin general you use the adfc-config file is you use adf rich faces.
    Timo

  • Working with multiple faces-config.xml files

    I would organize the menu definitions of my application in different faces-config.xml files. I would also put the label in different properties files.
    The SRDemo application uses a unique properties file for the menu used in the el expression from the faces-config.xml.
    Is it possible to have the same approach with not only one faces-config.xml file but has many faces-config.xml i want for my application.
    If yes does the binding name to be different or may be the same for each file ?

    We still have a litlle problem we don't find the reason. May be you can help us.
    The second menu level never appear in the menu list. The menu list appear as empty.
    The menu bar seem to be correct. We put twice the same model tree to be sure it was working well. Both menu appears. It is correct.
    Here is our faces-config-menu-flexsystem.xml file
    <?xml version="1.0" encoding="windows-1252"?>
    <!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
    <faces-config xmlns="http://java.sun.com/JSF/Configuration">
    <managed-bean>
    <description>Create menu item for flex system management</description>
    <managed-bean-name>menu_menuitem_FlexSystem_Create</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuItem</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>label</property-name>
    <value>#{resources['menu.FlexSystem.menuItem.create']}</value>
    </managed-property>
    <managed-property>
    <property-name>viewId</property-name>
    <null-value/>
    </managed-property>
    <managed-property>
    <property-name>outcome</property-name>
    <value>linkToCreateNewFlexSystem</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <description>Manage menu item for flex system management</description>
    <managed-bean-name>menu_menuitem_FlexSystem_Manage</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuItem</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>label</property-name>
    <value>#{resources['menu.FlexSystem.menuItem.manage']}</value>
    </managed-property>
    <managed-property>
    <property-name>viewId</property-name>
    <value>\FlexHome.jspx</value>
    </managed-property>
    <managed-property>
    <property-name>outcome</property-name>
    <value>linkToManageFlexSystem</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <description>Root menu item for flex system management</description>
    <managed-bean-name>menu_menuitem_FlexSystem_Root</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuItem</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>children</property-name>
    <list-entries>
    <value-class>flex.view.util.MenuItem</value-class>
    <value>#{menu_menuitem_FlexSystem_Create}</value>
    <value>#{menu_menuitem_FlexSystem_Manage}</value>
    </list-entries>
    </managed-property>
    <managed-property>
    <property-name>label</property-name>
    <value>#{resources['menu.FlexSystem.menuItem.root']}</value>
    </managed-property>
    </managed-bean>
    <application>
    <message-bundle>flex.view.resources.MenuFlexSystemProperties</message-bundle>
    <locale-config>
    <supported-locale>fr_CH</supported-locale>
    </locale-config>
    </application>
    <managed-bean>
    <managed-bean-name>resources</managed-bean-name>
    <managed-bean-class>flex.view.util.ResourceAdapter</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    <navigation-rule>
    <from-view-id>/FlexHome.jspx</from-view-id>
    <navigation-case>
    <from-outcome>linkToCreateNewFlexSystem</from-outcome>
    <to-view-id>/CreateNewFlexSystem.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    <navigation-rule>
    <from-view-id>/FlexHome.jspx</from-view-id>
    <navigation-case>
    <from-outcome>linkToManageFlexSystem</from-outcome>
    <to-view-id>/ManageFlexSystem.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <managed-bean-name>menu_FlexSystem</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuTreeModelAdapter</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>childProperty</property-name>
    <value>children</value>
    </managed-property>
    <managed-property>
    <property-name>listInstance</property-name>
    <list-entries>
    <value-class>flex.view.util.MenuItem</value-class>
    <value>#{menu_menuitem_FlexSystem_Root}</value>
    <value>#{menu_menuitem_FlexSystem_Root}</value>
    </list-entries>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <managed-bean-name>menuModel</managed-bean-name>
    <managed-bean-class>flex.view.util.MenuModelAdapter</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    <managed-property>
    <property-name>viewIdProperty</property-name>
    <value>viewId</value>
    </managed-property>
    <managed-property>
    <property-name>instance</property-name>
    <value>#{menu_FlexSystem.model}</value>
    </managed-property>
    </managed-bean>
    </faces-config>

  • Issue with faces-config.xml file

    Hi,
    I'm working on a project which needs more no. of JSF Pages and JSF Navigations,
    But when i trying to creat pages more than 25 pages,the process becoming too slow,does this
    effects the Application performance?Can any one suggest me why it happens and what are the
    limitations for creating the JSF pages.
    Does their any alternative to solve this Issue,I'm thing to create more faces-config.xml files as the
    Jsf pages increases,does this solves?
    Please suggest me.
    Thank you,
    Bandaru,

    Hi Bandaru,
    Are you trying to use the visual diagram option of faces-config? Coz i encountered difficulties when using it with many pages (more than 40) and the faces-config.oxd_faces was no longer able to support the diagram. "Solution" was to use only the overview and the sources of the faces-config. I don't know exactly but my problems were caused by the faces-config.oxd_faces and i don't think it affects performances for the application.
    For information, that was on a Jdev 10.1.3.0.4
    Regards,
    Tif

  • Reference faces-config.xml file from java code.

    I would like to reference the navigation rules I have set up in my faces-config.xml file from inside my source code.
    For example:
    Navigation Rule:
    <navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
    <from-outcome>pricingEngine</from-outcome>
    <to-view-id>/faces/template/t_pricing_engine.jsf</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>
    I would like do some sort of lookup by 'pricingEngine' and get '/faces/template/t_pricing_engine.jsf' back.
    Any ideas?

    I would like to reference the navigation rules I have set up in my faces-config.xml file from inside my source code.
    For example:
    Navigation Rule:
    <navigation-rule>
    <from-view-id>*</from-view-id>
    <navigation-case>
    <from-outcome>pricingEngine</from-outcome>
    <to-view-id>/faces/template/t_pricing_engine.jsf</to-view-id>
    <redirect/>
    </navigation-case>
    </navigation-rule>
    I would like do some sort of lookup by 'pricingEngine' and get '/faces/template/t_pricing_engine.jsf' back.
    Any ideas?

  • Can i make more than one faces-config.xml file ?

    Can i make more than one faces-config.xml file under one project or application, if yes than how it will link.

    Just that you know,
    In the second week of july I was taking the Jdeveloper/Jheadstart course at Oracle Netherlands. During that course we were asked to split the faces-config. After splitting it, we were not able to find the navigation rules that were defined in the first faces-config in the web.xml. The Jdeveloper IDE was confused........
    However, we were able to use the navigation rules (type in manualy) and that worked in the application.
    I talked about it with Steven Davelaar and he thought it might be a bug. I don't know if it's reported, and I don't know if it's fixed.
    So, if you get confused.... it works, but Jdeveloper might have some problems with it.
    Luc Bors

  • Creating jsf faces-config.xml file

    Hello.
    I'm a newbee on Sun Java Studio Enterprice and have just converted from Borland Jbuilder.
    In borland, if I create a new "webmodule" and include the jfs library, Borland automaticaly creates the faces-config.xml file for me. The IDE then helps me keep this file up to date.
    After creating a new project in Sun Java Studio Enterprice I have gone into propereties and included the jsf-1_1_01.zip file (I googled jsf library and found this file. If I include this file I get access to the <h: -taglib etc so it seems to be working). But the IDE doesn't create the faces-config.xml file.
    Do I need to create this manually or what do I do wrong?

    As an alternative to Creator (which mostly implies WYSIWYG editing of JSP pages) you can consider NetBeans 5.0 or NetBeans 5.5 Beta. They also support JSF.

  • Navigation Rule not found in faces-config.xml file

    Hi All,
    I have a B2C custom Webshop application where in the startpage i have a client logo and when i click on that it will navigate to another page for that i have a header.xhtml page in that i have a code <h:link id="iLkL" outcome="toStartPage" value="#{i18n['main.ui.header.logo']}" styleClass="fw-header-logo"> but i was unable to find  <Navigation-rule> of  toStartPage which is mentioned in the outcome="toStartPage" in the faces-config.xml file. I have checked in the standard component also but didn't find anything. Please help me where can i find the toStartpage value.
    Regards,
    Rahul.

    Hi Rahul,
    As correctly mentioned by Steffen earlier, the navigation targets are maintained in the ui-repository.xml files (or navigation-rules.xml files) for each module. Since, you would like to see the definition of the target toStartPage (which is a target accessible and relevant throughout the application), it should be in the WEC main module's (wec/~/main/ui) ui-repository.xml file. Please note that sometimes, the targets are maintained in a file called navigation-rules.xml, which itself is then included into the ui-reppsitory.
    Please let me know if you got what you need here.
    Best Regards
    Pranshu Agarwal

  • [Faces] Criterias for multiple faces-config.xml files...

    Hi, I'm working in a big development proyect migrating an ERP. We know the mechanics of having multiple "faces-config" files, but is there some recommendation about the number of pages supported, or the total file size, or any other? We have found that jDeveloper has serious performance problems (in the development environment) with a big number of pages and navigation rules in one config file, but will it be the same if there are a lot of config files?
    Has someone come to the same questions? Can someone share his or her experience on this particular matter?
    Thanks for your

    See Re: Very slow performance in Jdeveloper

  • JDeveloper gets slow with a lot of managed beans declared in faces-config

    Hello,
    I have an application with a lot of managed-beans (in fact, hundreds of backing beans). When I open the visual designer, it takes a long time to render the page, and after it gets very slow. Even the source view gets slow. When I remove some parts of these managed beans, JDeveloper back to normality.
    The problem is that the JDeveloper is so slow that I just can not do anything in JSPs.
    Anyone have any idea?
    I am very grateful for any help.
    Thanks.
    Edited by: gutogarcia on 22/01/2010 09:33

    ThDn,
    You can avoid adding unnecessary getters and setters of UI components in backing bean by selecting the option "Do not automatically expose UI Components in a Managed Bean" option when creating the Page.
    The nice thing is that in JDev 11g and in latest version of JDev 10g this option is selected by default when creating new pages.
    However in older JDev 10g versions the default was "Expose UI Components to a Managed Bean" so if developer did not change it during page creation it is possible that there would have been lots of unnecessary getters and setters in the backing bean.
    Luiz,
    As you say that this was fine in TP4 it could be that in newer JDev version there might have been added some new feature that caused this slowness.
    When you remove unnecessary getters/setters from you backing beans, you will have to modify the JSPs and remove the bindings from the UI components as well.
    Thanks
    Mitesh

Maybe you are looking for

  • Activation Failure for Creative Suite 5.5 Web Premium Subscription

    Hi, Signed up for the subscription model a week ago and worked fine without issue; came in to work on Monday and was asked to activate photoshop; it failed but let me continue. Tried loading up photoshop again today but now it says can't continue wit

  • Macbook 13.3" 2.4gHz MB404LL/A  BATTERY

    What battery model # (part number) will power my Macbook 13.3" 2.4gHz MB404LL/A (A1181) Macbook4,1 ?  Are there several model options (different mAh, etc)? Which performs the best?

  • How do I get my internet working?

    Hey all. Here's my issue. As shown below, I have a house, and a guest house. The main house has internet that works just fine, however, it doesn't reach all the way to the guest house. We have the two airport utilities shown below, and are fine with

  • Use of Project(CMOD) in exits:

    Hi all, Can anybody tell me what is the exact use of Project in user exits. Thanks in advance.

  • Why does Magic Bullet Looks not work

    Help, I am having troubles with the plugin Magic Bullet Looks working with FCP X. I understand it is up to Apple to update and fix this. Andy news on this issue? Tjapko