Read faces-config.xml in the runtime

I coding a new phaselistener in my app...
I need to list all managed-beans inside faces-config.xml and the classes...
Exists way to get this information without parse manually faces-config.xml ?
The API has way ?

No.
Good practice is to extend or implement all backing beans one superbean, for example BaseBean, and then in the phaselistener do something like:if (someFoundObject instanceof BaseBean) {
    // it's a managed bean instance.
}

Similar Messages

  • Faces-config.xml is the only configuration file or we can keep more

    Hi All,
    1) faces-config.xml is the only name specification allowed in JSF for configuration file or can we use another name for this configuration (like as struts) ?
    2) can we have multiple configuration files in JSF like as struts contains multiple configuration files for navigation ?
    Thanks,
    Rajesh Yarlagadda

    http://one-size-doesnt-fit-all.blogspot.fi/2007/01/using-multiple-faces-configxml-files-in.html
    Edited by: Nik on Sep 25, 2012 1:13 AM

  • What is the rule for adding application elements to faces-config.xml

    I have posed this question before, but was unable to get an answer so here goes again.
    What is the rule for adding more than one application element to the faces-config.xml?
    The schema documents that 1-n are possible, but why and when should I do this?
    --W                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    sorry if you don't login in tomcat administration before. you must enter login and password of a manager user on tomcat .
    The user is the one you give when installing tomcat.
    If you have forgotten it : see it to: C:\Program Files\Apache Software Foundation\Tomcat 6.0\conf\tomcat_users.xml
    and choose one whop have role='manager'

  • Splitting faces-config.xml into multiple parts

    Hey Everybody,
    I'm trying to split up my faces-config.xml file into application specific and deployment specific parts. I've managed to everything set-up so far but I'm having a problem with beans. I've got a bean which contains most of the application specific attributes but the problem is that some of the attributes are deployment specific and some are application specific.
    In the past, I could get around this by having two faces-config.xml files which each defined the bean but only specified "their" attributes. But I've now found that I can only define the bean only once. The bean will get the attributes from one file but not the other. So how can I get around this? Could I do a faces-config.xml include statement? Do I have to create a deployment-specific bean?
    Mark

    We have been referencing the same managed bean in different faces-config.xml files for a couple of years and it really did work until the latest release of JDeveloper. What we had been doing was to put properties that would change between the development and deployed versions in different faces-config.xml files; the goal being to isolate all the properties that needed to be changed for deployment in a single file that we could automatically replace with Ant when we build the production release.
    But just because it worked in the past doesn't mean that it was supposed to work.
    Thanks,

  • Studio creator and faces-config.xml

    How can I configure Sun Studio Creator to use /WEB-INF/faces-config.xml for all configuration items. Currently navigation and managed beans are seperated into 2 files. I have a bunch of JSF application with using another tool that I would like to test editing using Studio Creator but the Sun Studio Creator ignores the faces-config.xml for the navigation editor and managed bean editor.

    Hi ,
    The follwing link may probably answer your query.
    http://swforum.sun.com/jive/thread.jspa?threadID=50215&tstart=15
    Regards.,

  • Difference between standard-faces-config.xml and /WEB-INF/faces-config.xml

    Reading standard config org/apache/myfaces/resource/standard-faces-config.xml
    Reading config /WEB-INF/faces-config.xml
    Iam getting these in tomcat server,iam using netbeans5.5.1
    Can any one tell me the difference between the standard-faces-config.xml and the /WEB-INF/faces-config.xml
    because i find some repeatition
    06-Oct-2007 09:25:19 org.apache.myfaces.webapp.StartupServletContextListener initFaces
    06-Oct-2007 09:25:19 org.apache.myfaces.webapp.StartupServletContextListener initFaces
    INFO: ServletContext 'C:\jsfprogrammes\HiTech\build\web\' initialized.
    06-Oct-2007 09:25:19 org.ajax4jsf.cache.CacheManager getCacheFactory
    INFO: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
    06-Oct-2007 09:25:19 org.ajax4jsf.cache.LRUMapCacheFactory createCache
    INFO: Creating LRUMap cache instance using parameters: {org.apache.myfaces.CHECK_EXTENSIONS_FILTER=true, org.apache.myfaces.DETECT_JAVASCRIPT=false, org.apache.myfaces.ENABLE_CLIENT_SIDE_VALIDATION=true, org.apache.myfaces.SECRET=NzY1NDMyMTA=, org.apache.myfaces.VALIDATE=true, net.sf.jsfcomp.chartcreator.USE_CHARTLET=true, org.apache.myfaces.ALLOW_JAVASCRIPT=true, org.apache.myfaces.PRETTY_HTML=true, org.apache.myfaces.AUTO_SCROLL=true, javax.faces.STATE_SAVING_METHOD=server, org.apache.myfaces.redirectTracker.POLICY=org.apache.myfaces.custom.redirectTracker.policy.FullRedirectTrackPolicy, org.apache.myfaces.ADD_RESOURCE_CLASS=org.apache.myfaces.renderkit.html.util.DefaultAddResource}
    06-Oct-2007 09:25:19 org.ajax4jsf.cache.LRUMapCacheFactory createCache
    INFO: Creating LRUMap cache instance of default capacity
    06-Oct-2007 09:25:19 org.ajax4jsf.cache.CacheManager getCacheFactory
    INFO: Selected [org.ajax4jsf.cache.LRUMapCacheFactory] cache factory
    06-Oct-2007 09:25:19 org.ajax4jsf.cache.LRUMapCacheFactory createCache
    INFO: Creating LRUMap cache instance using parameters: {org.apache.myfaces.CHECK_EXTENSIONS_FILTER=true, org.apache.myfaces.DETECT_JAVASCRIPT=false, org.apache.myfaces.ENABLE_CLIENT_SIDE_VALIDATION=true, org.apache.myfaces.SECRET=NzY1NDMyMTA=, org.apache.myfaces.VALIDATE=true, net.sf.jsfcomp.chartcreator.USE_CHARTLET=true, org.apache.myfaces.ALLOW_JAVASCRIPT=true, org.apache.myfaces.PRETTY_HTML=true, org.apache.myfaces.AUTO_SCROLL=true, javax.faces.STATE_SAVING_METHOD=server, org.apache.myfaces.redirectTracker.POLICY=org.apache.myfaces.custom.redirectTracker.policy.FullRedirectTrackPolicy, org.apache.myfaces.ADD_RESOURCE_CLASS=org.apache.myfaces.renderkit.html.util.DefaultAddResource}
    06-Oct-2007 09:25:19 org.ajax4jsf.cache.LRUMapCacheFactory createCache
    INFO: Creating LRUMap cache instance of default capacity

    I just said that it is not necessary to add something special to faces-config.xml in order to get JSF works in portlet environment. I successfully use JSF with WSP and JBoss Portal (MyFaces).
    MyFaces has own implementation of bridge called MyFacesGenericPortlet while for Sun RI you have to use JSF Portlet Bridge. JSF Portlet bridge can be used with MyFaces as well.
    Such a bridge invokes lifecycle.execute or lifecycle.render to execute JSF phases depending on request. So all phases or Render Response phase is invoked accordingly.

  • Localization of adf faces-config.xml

    I have defined my ADF process train component and menu items in my faces-config.xml. The definition has got the label for these components in the faces-config.xml How can I localize these labels so that I can support multiple languages. The managed bean for my process train component is
    <managed-bean>
    <managed-bean-name>customerInfo</managed-bean-name>
    <managed-bean-class>view.faces.menu.PersonalTrackerMenuItem</managed-bean-class>
    <managed-bean-scope>none</managed-bean-scope>
    <managed-property>
    <property-name>viewId</property-name>
    <value>/customerinfo.jsp</value>
    </managed-property>
    <managed-property>
    <property-name>label</property-name>
    <value>Customer Information</value>
    </managed-property>
    <managed-property>
    <property-name>outcome</property-name>
    <value>guide.customerinfo</value>
    </managed-property>
    </managed-bean>
    I would like to know how to get the Customer Information label from a properties file instead of hardcoding it in the faces-config.xml

    Hi Frank
    Thanks for your response. I understand that we need to use different locales but for this to work all the labels need to be parameterized to the properties file. This is straight forward when it comes to labels in the JSP pages where we load the bundle with
    <f:loadBundle basename="myBundle.myBundle" var="sampleBundle"> and refer to a property as <f:commandButton value="#{sampleBundle.myButtonText}"/> my problem is how to do this when the label I want to parameterize is in the faces-config.xml

  • 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.

  • Component and renderer can't share the same name in face-config.xml

    Hi All,
    I've noticed that a component and a renderer can't share the same name in <face-config.xml>.
    For instance,
    <component>
    <component-type>tree</component-type>
    <component-class>com.xxx.tree.component.Tree</component-class>
    </component>
    <render-kit>
    <renderer>
    <renderer-type>tree</renderer-type>
    <renderer-class>com.xxx.tree.renderer.Tree</renderer-class>
    </renderer>
    </render-kit>     
    generates a cryptic error message.
    It's not a big deal but would be nice to support it.
    The workaround of course is to use a different name for the component and renderer (tree and treeRenderer for instance)
    Stephane

    i dont know why it doesn't work for you. It works for me alright. Can u elaborate on what error messages you are getting? It maybe some other problem.

  • 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.

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Include another property file in the sun-faces-config.xml

    Hi,
    How can I include other property file in the sun-faces-config.xml ? like this
    <component>
    <property>
    <display-name>test</display-name>
    </property>
    <include path="core.xml">
    </component>
    Thanks
    Wilson

    Hi,
    Have a look the below thread
    http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=52211
    may help you
    MJ

  • Problem w.r.t. JSF 2.0 with faces-config.xml

    Hi All,
    I am trying to evaluate the features of JSF2.0.
    For that, I have created a very simple application with "JSF 2.0.2".
    There is a page that displays a composite component and some other form related components (inputtext, commandbutton).
    When I deploy my application without any faces-config.xml file, everything renders perfectly fine.
    When I deploy the app with faces-config.xml (even an empty one without any configuration), none of the components get rendered.
    Only the html elements get displayed.
    I need to define some navigation-rules in my config file. I am not sure how to go further from here.
    The app server I am using for deploying my app is GlassFish(v3).
    Any help or pointers towards solving my problem are highly appreciated.
    You can find the xhtml file, etc of my project below.
    Thank you,
    With best regards,
    Praveen
    web.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
         <context-param>
              <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
              <param-value>.xhtml</param-value>
         </context-param>
         <servlet>
              <servlet-name>Faces Servlet</servlet-name>
              <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
              <load-on-startup>1</load-on-startup>
         </servlet>
         <servlet-mapping>
              <servlet-name>Faces Servlet</servlet-name>
              <url-pattern>*.jsf</url-pattern>
         </servlet-mapping>
    </web-app>
    faces-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <!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">
    </faces-config>
    resources->acicomp->namesection.xhtml
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:f="http://java.sun.com/jsf/core"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:composite="http://java.sun.com/jsf/composite">
    <composite:interface>
    </composite:interface>
    <composite:implementation>
         <h:panelGroup>
         <h:panelGrid columns="2">
              <h:outputText value="Name: "/>
              <h:inputText value="myName"/>
              <h:outputText value="Company: "/>
              <h:inputText value="myComp"/>
         </h:panelGrid>
         </h:panelGroup>
    </composite:implementation>
    </html>
    index.xhtml
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html"
          xmlns:aci="http://java.sun.com/jsf/composite/acicomp">
    <h:head>
         <title>JSF Test Program</title>
    </h:head>
    <h:body>
         <p>My Simple Test Program</p>
            <h:form id="testForm" >
                <p>TEST</p>
                <aci:namesection></aci:namesection>
                <h:inputText id="username" value="John" />
                <h:commandButton id="submit" action="response" value="Submit"/>
            </h:form>
    </h:body>
    </html>

    I found the problem.
    The dtd location of the faces-config.xml had to be changed. It was pointing to the schema of 1.1.
    With the following faces-config.xml, my application worked perfectly fine.
    <?xml version="1.0"?>
    <faces-config xmlns="http://java.sun.com/xml/ns/javaee"
                  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"
                  version="2.0">             
    </faces-config>

  • How to configure multiple jsp files with diff beans in faces-config.xml??

    Hi All,
    I have 2 seperate jsp pages one is a login page and the other is the main application page.Now i am handling both the pages with seperate Bean class with respective setter and getter methods.How can i state the same in faces-config.xml file???..
    Is the below way correct???
    <?xml version='1.0' encoding='UTF-8'?>
    <!-- =========== FULL CONFIGURATION FILE ================================== -->
    <faces-config version="1.2"
        xmlns="http://java.sun.com/xml/ns/javaee"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
                       http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">
        <managed-bean>
                <managed-bean-name>LoginForm</managed-bean-name>
                <managed-bean-class>useraccess.LoginForm</managed-bean-class>
                <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
        <navigation-rule>
                <from-view-id>/login.jsp</from-view-id>
            <navigation-case>
                <from-action>#{LoginForm.CheckValidUser}</from-action>
                <from-outcome>success</from-outcome>
                <to-view-id>/success.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-action>#{LoginForm.CheckValidUser}</from-action>
                <from-outcome>fail</from-outcome>
                <to-view-id>/fail.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
        <managed-bean>
                <managed-bean-name>DSRApplication</managed-bean-name>
                <managed-bean-class>DSRApplication.LoginForm</managed-bean-class>
                <managed-bean-scope>request</managed-bean-scope>
        </managed-bean>
        <navigation-rule>
                <from-view-id>/DSR.jsp</from-view-id>
            <navigation-case>
                <from-action>#{DSRApplication.checkValidDateInAllFields}</from-action>
                <from-outcome>alldatasuccess</from-outcome>
                <to-view-id>/success.jsp</to-view-id>
            </navigation-case>
            <navigation-case>
                <from-action>#{DSRApplication.checkValidDateInAllFields}</from-action>
                <from-outcome>datafail</from-outcome>
                <to-view-id>/fail.jsp</to-view-id>
            </navigation-case>
        </navigation-rule>
    </faces-config>Thanks in advance to all.
    regards,
    Viswanadh.

    Thanks ejp for the reply.
    Since i am a beginner even i dont know the exact reason to answer you for why am i using JSP with Facelets.Kindly provide me the suggestion and valuable information you have so that i can learn.
    Apart from this i want to know whether the way provided in that faces-config.xml is possible or do we have a way to make that possible???
    regards,
    Viswanadh.

  • How to specify multiple message bundles in faces-config.xml

    Hi
    I have different properties file which I want to use as message bundle.
    Message.properties
    Help.properties
    When I specify this in faces-config.xml
    <application>
    <message-bundle>/Message</message-bundle>
    <message-bundle>/Help</message-bundle>
    </application>
    and now when I try to use that in my jsp page like this
    <f:loadBundle basename="/Message" var="message"/>
    <f:loadBundle basename="/Help" var="help"/>
    and access any messagestring from those files I can not excess either of them. But when I use only one of them it works fine.
    Am I doing something wrong or I can not do this thing at all??
    Thanks in advance.

    I only specify one properties file in the <application> tag. That one is used for system messages. I have other properties files for labels, and another for just standard app text, so in my faces-config.xml I have something like this:
    <application>
    <message-bundle>message</message-bundle>
    <locale-config>
    <default-locale>en</default-locale>
    </locale-config>
    </application>
    where my message.properties is used for system messages (validation, etc).
    I don't list the other property files there. I have two more that I use, labels_en.properties, and standard_en.properties. Labels are words that have a : at the end or a *: for required fields. Standard are just other words that I use in my application. So on every page that I have, I start out with the following header:
    <html>
    <f:view locale="en_US">
    <head>
    <f:loadBundle basename="label" var="label"/>
    <f:loadBundle basename="standard" var="standard"/>
    <title>
    .....

Maybe you are looking for

  • Need Help to Draw and Drag Triangle - URGENT

    Hi everyone - I am developing various proofs of the pythagora's theorem and the following code draws a triangle on screen and the proof follows - but i need to know how to drag the triangle such tht 1 angle is always set to 90 degrees. i.e. i need to

  • My iphone 5 won't charge :(

    My iphone 5 won't charge with the cable I bought, I don't know if its because maybe it isn't an apple product? Can somone please help me! thank you

  • Variable exit in sap bi 7.0  is not working in web report

    Hi Experts,     I had wrote a variable exit to get latest run date at variable screen for a variable.On the base query i have created query view.This query view is working fine when i am viewing from analyzer  but on  the web Im not getting latest ru

  • Failed formatting of new hard drive

    I installed a new Caviar SE 120Gbyte SATA II hard drive in my PowerMacG5. This will serve as a back-up to the start-up HD. When I started up the computer, it was not recognized. I used the "erase" and "partition" options in disk utility to no avail (

  • Moving rented movies to Apple TV

    I rented a movie on my IMac but when I tried to watch on my Apple tv it doen't appear. i can see the ones I've bought but not the ones I rent. How can I watch rented movies on apple tv?