How to change MANAGED-BEAN-SCOPE??????

Hi Gurus,
How to change the managed-bean-scope? In my ADF application I have created one backing bean which has attched with the page fragment. I cant able to set the bean scope other than REQUEST....
If I set the bean scope request, then page and the inside fragment is rendering without any error. But I need to make that bean scope to pageFlow... but if I do, getting the below error. Non of the scopes are working except request... Please help me how to set the other scope which will solve my major development issue!!!!
Error:
Error trying to include:viewId:/advsearch-flow-definition/advUserSearch uri:/app/advUserSearch.jsffjavax.faces.FacesException: javax.el.PropertyNotFoundException: Target Unreachable, identifier 'UserSearch' resolved to null
My ADFC-Config.xml:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
<managed-bean>
<managed-bean-name>backing_app_idm</managed-bean-name>
<managed-bean-class>edu.syr.oim.backing.app.Idm</managed-bean-class>
<managed-bean-scope>backingBean</managed-bean-scope>
<!--oracle-jdev-comment:managed-bean-jsp-link:1app/idm.jspx-->
</managed-bean>
<managed-bean>
<managed-bean-name>backing_app_userMgmt</managed-bean-name>
<managed-bean-class>edu.syr.oim.backing.app.UserMgmt</managed-bean-class>
<managed-bean-scope>backingBean</managed-bean-scope>
<!--oracle-jdev-comment:managed-bean-jsp-link:1app/userMgmt.jspx-->
</managed-bean>
*<managed-bean>*
*<managed-bean-name>UserSearch</managed-bean-name>*
*<managed-bean-class>edu.syr.oim.backing.app.UserSearch</managed-bean-class>*
*<managed-bean-scope>request</managed-bean-scope>*
*</managed-bean>*
</adfc-config>
-kln
Edited by: klogube on Jan 14, 2010 7:23 AM

*public class UserSearch {*
private RichTable searchResultTable;
private Row currentRow;
private String selectedNetID;
private RichInputText inputOne;
private RichInputText inputTwo;
private RichInputText inputThree;
private RichSelectOneChoice choiceOne;
private RichSelectOneChoice choiceTwo;
private RichSelectOneChoice choiceThree;
private RichRegion region;
private String choiceOneVal;
private String choiceTwoVal;
private String choiceThreeVal;
DCBindingContainer bindings;
int choiceOneRowIndex;
int choiceTwoRowIndex;
int choiceThreeRowIndex;
Row choiceOnerw;
Row choiceTworw;
Row choiceThreerw;
String choiceOneUserSelected = null;
String choiceTwoUserSelected = null;
String choiceThreeUserSelected = null;
static String  txnTypeOne  = null;
static String  txnTypeTwo  = null;
static String  txnTypeThree  = null;
String netid;
RequestContext requestContext = RequestContext.getCurrentInstance();
HashMap rcBackupHM = new HashMap();
FacesContext facesContext = FacesContext.getCurrentInstance();
Application app = facesContext.getApplication();
ExpressionFactory elFactory = app.getExpressionFactory();
ELContext elContext = facesContext.getELContext();
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest)fc.getExternalContext().getRequest();
HttpSession session = request.getSession();
*public UserSearch() {*
*public String userSelected() {*
FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
currentRow = binding.getRow();
selectedNetID = (String) currentRow.getAttribute("netid");
requestContext.getPageFlowScope().put("netid",selectedNetID);
return "goToDetails";
** Invoke this method when user double click the row in searchResult*
*public void doDbClick(ClientEvent clientEvent) {*
FacesCtrlHierNodeBinding binding = (FacesCtrlHierNodeBinding) searchResultTable.getSelectedRowData();
currentRow = binding.getRow();
selectedNetID = (String) currentRow.getAttribute("netid");
requestContext.getPageFlowScope().put("netid",selectedNetID);
*try{*
FacesContext facesCtx = FacesContext.getCurrentInstance();
NavigationHandler nh = facesCtx.getApplication().getNavigationHandler();
nh.handleNavigation(facesCtx, "", "goDetails");
*// Refresh the current region; advse1 is the id of the region component inside jspx page*
AdfFacesContext.getCurrentInstance().addPartialTarget(region);
*catch(Exception e){ }*
*public void setSearchResultTable(RichTable searchResultTable) {*
this.searchResultTable = searchResultTable;
*public RichTable getSearchResultTable() {*
return searchResultTable;
*public void setInputOne(RichInputText inputOne) {*
this.inputOne = inputOne;
*public RichInputText getInputOne() {*
return inputOne;
*public void setInputTwo(RichInputText inputTwo) {*
this.inputTwo = inputTwo;
*public RichInputText getInputTwo() {*
return inputTwo;
*public void setInputThree(RichInputText inputThree) {*
this.inputThree = inputThree;
*public RichInputText getInputThree() {*
return inputThree;
*public void setChoiceOne(RichSelectOneChoice choiceOne) {*
this.choiceOne = choiceOne;
*public RichSelectOneChoice getChoiceOne() {*
return choiceOne;
*public void setChoiceTwo(RichSelectOneChoice choiceTwo) {*
this.choiceTwo = choiceTwo;
*public RichSelectOneChoice getChoiceTwo() {*
return choiceTwo;
*public void setChoiceThree(RichSelectOneChoice choiceThree) {*
this.choiceThree = choiceThree;
*public RichSelectOneChoice getChoiceThree() {*
return choiceThree;
*public void setChoiceOneVal(String choiceOneVal) {*
this.choiceOneVal = choiceOneVal;
*public String getChoiceOneVal() {*
return choiceOneVal;
*public void setChoiceTwoVal(String choiceTwoVal) {*
this.choiceTwoVal = choiceTwoVal;
*public String getChoiceTwoVal() {*
return choiceTwoVal;
*public void setChoiceThreeVal(String choiceThreeVal) {*
this.choiceThreeVal = choiceThreeVal;
*public String getChoiceThreeVal() {*
return choiceThreeVal;
*public void setRegion(RichRegion region) {*
this.region = region;
*public RichRegion getRegion() {*
return region;
Can you please explain how to define the 2nd bean in the pageFlowScope and injnect?...bacially my problem is I am loosing the pageFlowScope value when I navigate from first page to next page which I am setting by this above class....I need to carry forward the netid which I am losing ...any idea plz

Similar Messages

  • Manage Bean Scope in Faces Config

    Hi,
    I would like to know if its possible to bind the bean at request level if the bean data involves multiple modifications. Currently I am facing a problem with respect to manage bean scope defination. If i keep the bean scope at request level the bean data is not availabe for modification in next request as a result I need to keep the bean at session level causing heavy loading of session object.
    Can any one advice how to keep bean scope at requesat level and still the data is available for modification.
    Regrds

    Hey ! this is exactly my problem!! :)
    http://forum.java.sun.com/thread.jspa?threadID=611607&tstart=0

  • How to refactor managed bean

    Disclaimer: I am very new to ADF.
    I have a fragment that uses a pageFlow scoped managed bean. Everything works fine but now I have to extract a piece of that fragment and use it into another fragment. I would like to extract all parts related to that fragment into a specific managed bean and then use that managed bean into the "parent" managed bean. To clarify what I want to do:
    Current:
    public class BigManagedBean {
    private String classMemberSpecificToA;
    private String classMemberSpecificToB;
    Refactored:
    public class BigManagedBean {
    private SpecificToAManagedBean aBean;
    private SpecificToBManagedBean bBean;
    public SpecificToAManagedBean {
    private String classMemberSpecificToA;
    public SpecificToBManagedBean {
    private String classMemberSpecificToB;
    Q: How to instantiate aBean and bBean? What is the best practice for doing that?
    ADF 11.1.1.6

    Three ways:
    1) instantiate the variable with the bean
    public class BigManagedBean {
    private SpecificToAManagedBean aBean = new SpecificToAManagedBean ();
    private SpecificToBManagedBean bBean = new SpecificToBManagedBean ();
    2) in the constructor of the big bean
    public class BigManagedBean {
    private SpecificToAManagedBean aBean;
    private SpecificToBManagedBean bBean;
      public BigManagedBean()
        aBean = new SpecificToAManagedBean ();
        bBean = new SpecificToBManagedBean ();
    3) in the getter of aBean
    public class BigManagedBean {
    private SpecificToAManagedBean aBean = null;
    private SpecificToBManagedBean bBean = null;
      public SpecificToAManagedBean getABean()
        if (aBean == null)
             aBean = new SpecificToAManagedBean ();
        return aBean;
    Timo

  • How to include Managed bean class in build sciprt for taskflow (Jdev 11.4)

    Hi,
    I've developed a custom taskflow to be deployed in the webcenter spaces. The taskflow that I developed contains managed beans. I am using oracle provided build script with the sample application, to deploy custom taskflow. After the build, we don't see any .class files (managed bean files) in the generated war file. Once we deploy the taskflow into the space, it is failing may be because the managed bean class files are missing in the <taskflow>.war. Am i missing something? Should we specifically include the .class files in the build script?
    Below is the oracle provide build script..
    <?xml version="1.0" encoding="US-ASCII" ?>
    <!--Ant buildfile generated by Oracle JDeveloper-->
    <!--Generated Sep 29, 2009 11:47:41 PM-->
    <project name="WebCenterSpacesSharedLibExtension" default="all" basedir="."
    xmlns:wls="oracle.webcenter.tools.wls">
    <property file="../config.properties"/>
    <property file="build.properties"/>
    <import file="internal-targets.xml"/>
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
    <pathelement location="${jdeveloper.install.home.directory}/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar"/>
    </classpath>
    </taskdef>
    <target name="clean-stage"
    description="Cleans the output directory and generates the war"
    depends="clean, stage"/>
    <target name="deploy-shared-lib"
    depends="init-wls"
    description="Deploy the extending WebCenter shared library">
    <echo> ---------------------------- </echo>
    <echo> ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded ${wls.webcenter.app.target} ${customer.library.name}</echo>
    <exec logerror="true"
    executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
    dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
    <!--TODO:ExpDeploy Uncomment line after this and comment the one after that to deploy exploded. -->
    <arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded/${customer.library.name}.war ${wls.webcenter.app.target} ${customer.library.name}"/>
    <!--TODO:ExpDeploy Uncomment line below and comment line above to have non-exploded deploy -->
    <!--arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/${shared.library.name} ${wls.webcenter.app.target} ${customer.library.name}"/-->
    </exec>
    <echo> ---------------------------- </echo>
    <echo> Restarting the app </echo>
    <echo> ---------------------------- </echo>
    <exec logerror="true"
    executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
    dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
    <arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/redepwc.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} "/>
    </exec>
    </target>
    </project>
    Thanks in advance
    Nitin

    Hi,
    I've developed a custom taskflow to be deployed in the webcenter spaces. The taskflow that I developed contains managed beans. I am using oracle provided build script with the sample application, to deploy custom taskflow. After the build, we don't see any .class files (managed bean files) in the generated war file. Once we deploy the taskflow into the space, it is failing may be because the managed bean class files are missing in the <taskflow>.war. Am i missing something? Should we specifically include the .class files in the build script?
    Below is the oracle provide build script..
    <?xml version="1.0" encoding="US-ASCII" ?>
    <!--Ant buildfile generated by Oracle JDeveloper-->
    <!--Generated Sep 29, 2009 11:47:41 PM-->
    <project name="WebCenterSpacesSharedLibExtension" default="all" basedir="."
    xmlns:wls="oracle.webcenter.tools.wls">
    <property file="../config.properties"/>
    <property file="build.properties"/>
    <import file="internal-targets.xml"/>
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
    <classpath>
    <pathelement location="${jdeveloper.install.home.directory}/modules/net.sf.antcontrib_1.0.0.0_1-0b2/lib/ant-contrib.jar"/>
    </classpath>
    </taskdef>
    <target name="clean-stage"
    description="Cleans the output directory and generates the war"
    depends="clean, stage"/>
    <target name="deploy-shared-lib"
    depends="init-wls"
    description="Deploy the extending WebCenter shared library">
    <echo> ---------------------------- </echo>
    <echo> ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded ${wls.webcenter.app.target} ${customer.library.name}</echo>
    <exec logerror="true"
    executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
    dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
    <!--TODO:ExpDeploy Uncomment line after this and comment the one after that to deploy exploded. -->
    <arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/exploded/${customer.library.name}.war ${wls.webcenter.app.target} ${customer.library.name}"/>
    <!--TODO:ExpDeploy Uncomment line below and comment line above to have non-exploded deploy -->
    <!--arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/extspaces.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} ${oracle.jdeveloper.deploy.dir}/${shared.library.name} ${wls.webcenter.app.target} ${customer.library.name}"/-->
    </exec>
    <echo> ---------------------------- </echo>
    <echo> Restarting the app </echo>
    <echo> ---------------------------- </echo>
    <exec logerror="true"
    executable="${jdeveloper.install.home.directory}/oracle_common/common/bin/${wlst.executable}"
    dir="${jdeveloper.install.home.directory}/oracle_common/common/bin">
    <arg line="${extending.spaces.home.dir}/WebCenterSpacesSharedLibExtension/redepwc.py ${wls.userconfig} ${wls.userkey} ${wls.host}:${wls.port} "/>
    </exec>
    </target>
    </project>
    Thanks in advance
    Nitin

  • How to automate managed beans.xml update

    I am using JSC 2.0 ea and am trying to add a "loginBean" based on the example in java studio creator field guide. The process explained in the book, ie right-click "source package" add java package, right-click newly created package and add "managed bean" - this does not exist in jsc 2.0, so when you add a class file the managed-beans.xml file is not updated - is their an automated process to add a managed bean in jsc 2.0?

    Hi,
    Please post messages related to Creator 2 EA at the feedbacks programs portal. The URL is:
    https://feedbackprograms.sun.com/login.html
    Thanks,
    Creator Team

  • How to change & manage different ports in a mixed web environment (BSP/WAD)

    Hi everybody,
    our scenario is the following:
    We constructed a mixed environment web application, consisting out of a BSP application and WAD web templates. Unfortunately the url of web templates and the bsp-application differs - meaning the server is the same, but the port is different. That's why it is not easy to link the application each other, because for transportation reasons, we would like to have relative url paths.
    After searching the SDN and reading several help files, we found out, that the port of the BSP can be changed by adding an entry to the HTTPURLLOC table.
    See also: [Configuration Table HTTPURLLOC|http://help.sap.com/saphelp_nw70/helpdata/en/42/d547ab30b6473ce10000000a114e5d/frameset.htm]
    We managed to do that and in addition we created a BEX role for our BSP application. But with the new port the BSP does not appear in the browser window. So we still didn't fulfil our requirement to call the BSP in a include item of the WAD without passing the complete URL server:port/sap/bsp/...
    Question: How can we link the BSP out of the WAD environment, respectively is it possible to call the BSP with the same port, being used by the web templates...?
    Thanks for any comments and hints!
    Best regards,
    Sebastian

    Hi Raja and everybody,
    thank you for your comments... meanwhile we just solved the problem by appliying method two mentioned above. Therefore we created a Customer web item class as denoted in [Creating an ABAP Class for the Custom Extension Web Item|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/a1c1237d753ca2e10000000a42189b/content.htm].
    In the Initialize method I constructed the IFrame HTML-Code:
      DATA: serverURL TYPE STRING.
      DATA: serverPort TYPE STRING.
      DATA: bspName TYPE STRING.
      DATA: iFrameURL TYPE STRING.
    * Fetch the BSP port from internal table
      SELECT SINGLE VALUE FROM it_table.
    * Create iFrame URL
      serverURL = 'https://www.sap.com'.
      bspName = 'myBSP'.
      CONCATENATE serverURL ':' serverPort '/' bspName INTO iFrameURL.
    * Create the iFrame Tag
      CLEAR generatedHTML.
      generatedHTML = '<iframe src="%IFRAMEURL%" valign="top" width="100%"/>'.
      REPLACE '%IFRAMEURL%' IN generatedHTML WITH iFrameURL.
    In the execute the code is parsed with the method:
    CALL METHOD cl_bics_cons_webitem_util=>string_2_utf8_xstring
    Many thanks to Raja and everybody else for helping me!
    Sebastian

  • How to change managed path of a site collection (without backup/restore)?

    Hi
    Other than backup/restore a site collection to another site collection with different managed path, is there is any other way to change the managed path of a site collection directly using Powershell or Central Admin?

    Yes you can use powershell script to change the managed path.
    Reference
    http://jshidell.com/2012/06/26/moving-sharepoint-2010-site-collections-between-managed-paths-using-powershell/
    http://technet.microsoft.com/en-us/library/cc261845.aspx
    http://technet.microsoft.com/en-us/library/ff607693.aspx
    http://technet.microsoft.com/en-us/library/cc288905%28v=office.14%29.aspx
    Regards,
    Sairam Avacorp Technologies

  • How to change management pack in incident template in scsm

    We have created customized incident management pack and import that to scsm.Created templates using the this managementpack now i got request to edit or delete some Class properties in the customized managment pack.I have exported the management pack and
    trying to edit the Class properties but those are Grey out.
    Please let me know that how can i Edit or Delete the Class Properties in Customized management pack.
    And Also let me know that i have created Templates using Customized management pack if i delete that mp and import a new mp in to SCSM how can i update the template with new mp.I tied to chnage the management pack in template but it is greyout.
    Regards, H@ri

    In which management pack are your class extension stored? Is this a sealed management pack (did you seal the management pack)? If it is a sealed MP than you have to modify the unsealed MP and seal it again with the same key.
    If you export a sealed MP from SCSM it will be an unsealed copy of the MP but it doesn't work to modify this exported MP. So this is not an option.
    If you want to delete custom properties in a MP you have to make sure that these properties aren't in use in the templates or work items.
    Andreas Baumgarten | H&D International Group

  • Session scope managed bean is not instantiating?

    We have the need to use a session bean (rather than pageFlowScope) in our application.  But it looks like the session beans are not being instantiated at run time like other beans are.  I created a simple test case to verify.  One bean, named "MySessionBean", defined in the task flow as Session scope, then referenced in a view with an input text box, value:  #{sessionScope.MySessionBean.value1}. When I run the application,  I just get PropertyNotFoundException, Target Unreachable, 'MySessionBean' returned null.
    If I simply change the bean to use pageFlowScope, everything works fine.   I have debug code in the bean constructor, and it never gets called.   Is there some other step I am missing to have ADF instantiate the session bean?

    No luck, I tried it in both adfc-config.xml, and faces-config.xml.  I also tried moving the call to my view, from my bounded taskflow, into the adfc-config unbounded task flow, and then I ran that instead.  Still got the same error.    Here is my code from the the last round of tests with the view called in the main adfc-config.xml unbounded taskflow:
    adfc-config.xml:
    <?xml version="1.0" encoding="windows-1252" ?>
    <adfc-config xmlns="http://xmlns.oracle.com/adf/controller" version="1.2">
          <view id="testView">
                <page>/testView.jspx</page>
          </view>
          <managed-bean id="__2">
          <managed-bean-name id="__5">MySessionBean</managed-bean-name>
          <managed-bean-class id="__4">test.MySessionBean</managed-bean-class>
          <managed-bean-scope id="__3">session</managed-bean-scope>
        </managed-bean>
    </adfc-config>
    testView.jspx:
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
      <jsp:directive.page contentType="text/html;charset=UTF-8"/>
      <f:view>
        <af:document id="d1">
          <af:form id="f1">
            <af:inputText label="Label 1" id="it1"
                          value="#{sessionScope.MySessionBean.value1}"/>
          </af:form>
        </af:document>
      </f:view>
    </jsp:root>
    MySessionBean.java:
    package test;
    public class MySessionBean {
        private String value1="Hello World";
        public MySessionBean() {
            super();
        public void setValue1(String value1) {
            this.value1 = value1;
        public String getValue1() {
            return value1;

  • ADF Faces: How to get the ADF BindingContainer in a managed bean?

    Hi,
    I not sure how to get the BindingContainer instance from inside of a managed bean method. I have tried the following config, but it does not work in all situations.
      <managed-bean>
        <managed-bean-name>backing_showBooks</managed-bean-name>
        <managed-bean-class>view.backing.ShowBooks</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
        <managed-property>
          <property-name>bindingContainer</property-name>
          <property-class>oracle.adf.model.binding.DCBindingContainer</property-class>
          <value>#{bindings}</value>
        </managed-property>
        <!--oracle-jdev-comment:managed-bean-jsp-link:1showBooks.jsp-->
      </managed-bean>When an ActionListener- method of my ShowBooks bean is called the property bindingContainer is NULL!!
    Is there a save way to get the BindingContainer in my bean??
    Any hints are welcome.
    Thanks,
    Markus

    Maybe I just need another pair of eyes but when I set this up as explained and watch it in the debugger my method public void setBindingContainer(DCBindingContainer bc) gets called but bc is null. Can anyone help?
    Thanks
    Backing Bean-
    private DCBindingContainer bindingContainer;
    public void setBindingContainer(DCBindingContainer bc) {
    this.bindingContainer = bc;
    public DCBindingContainer getBindings() {
    return bindingContainer;
    //I just threw this method on there in case I was missing something & I also
    //tried using a getBindingContainer method above but that didn;t work.
    public void setBindings(DCBindingContainer bindings) {
    this.bindingContainer = bindings;
    adf-faces.conf entry
    <managed-bean>
    <managed-bean-name>backing_VunerabilityDetail</managed-bean-name>
    <managed-bean-class>viewcontroller.backing.VunerabilityDetail</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>bindingContainer</property-name>
    <property-class>oracle.adf.model.binding.DCBindingContainer</property-class>
    <value>#{bindings}</value>
    </managed-property>
    <!--oracle-jdev-comment:managed-bean-jsp-link:1VunerabilityDetail.jsp-->
    </managed-bean>

  • How invalidate a session managed bean

    I have a faces-config. xml file with the following content:
    <managed-bean>
    <managed-bean-name>pc_mybean</managed-bean-name>
    <managed-bean-class>mybean</managed-bean-class>
    <managed-bean-scope>session</managed-bean-scope>
    </managed-bean>
    For some reasons I needed to put it as session.
    Now I would like to know if there is a way to invalidate the session bean. Does someone know? How can I access to the bean with my java code?
    Thanks a lot.
    Didi

    the method to invalidate the bean:
         public static void resetManagedBean(String beanName) {
              getValueBinding(getJsfEl(beanName)).setValue(FacesContext.getCurrentInstance(), null);
         private static ValueBinding getValueBinding(String el) {
              return getApplication().createValueBinding(el);
         public static String getJsfEl(String value) {
              return "#{" + value + "}";
         }

  • ADF Faces and BC: Scope problem with managed bean

    Hi,
    I am using JDev 10.1.3 and ADF Faces with ADF BC.
    I have created a managed bean which needs to interact with the binding layer and also receive actions from the web pages. I have a managed property on the bean which is defined as follows:
    <managed-bean>
        <managed-bean-name>navigator</managed-bean-name>
        <managed-bean-class>ecu.ethics.view.managed.Navigator</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
          <property-name>bindings</property-name>
          <value>#{bindings}</value>
        </managed-property>
      </managed-bean>I need the been to session scope because it needs to keep previous and next pages to navigate the user through their proposal. If i use session scope (as above) i get the following error when i click on a comand link which references a method in the above bean: #{navigator.forwardNext_action} which returns a global forward.
    this is the exception:
    javax.faces.FacesException: #{navigator.forwardNext_action}:
    javax.faces.el.EvaluationException: javax.faces.FacesException:
    javax.faces.FacesException: The scope of the referenced object: '#{bindings}' is shorter than the referring object     at
    com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:78)     at
    oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:211) at
    javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)at
    javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)     at
    com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)     at
    com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)     
    at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)     at
    javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)how can i get around this?
    Brenden

    Hi pp,
    you need to create a managed (not backing) been set to session scope.
    You can call/reference the managed bean from your page.
    the backing bean is designed around a page lifecyle which is request oriented in it's design.
    This is a simple managed bean from faces-config.xml
    <managed-bean>
        <managed-bean-name>UserInfo</managed-bean-name>
        <managed-bean-class>ecu.ethics.admin.view.managed.UserInfo</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
          <managed-property>
          <property-name>bindings</property-name>
          <property-class>oracle.adf.model.BindingContext</property-class>
          <value>#{data}</value>
        </managed-property>
      </managed-bean>and the getters and setters for bindings in your session scope managed bean:
        public void setBindings(BindingContext bindings) {
            this._bindings = bindings;
        public BindingContext getBindings() {
            return _bindings;
        }you can access the model from the managed bean using the the BindingContext if needed.
    also have a look at JSFUtils from the ADF BC SRDemo application, there are methods in this class such as resolveExpression which demonstrate how to get the values of items on your page programatically using expression language. You can use this in your managed bean to get values from your pages.
    regards,
    Brenden

  • Scope of managed bean for a modifiable list

    I have a business entity set stored in database. I want to show them with JSF as elements of a list with each element having a delete button. If the database changes in the background because entitites are removed or inserted, the delete function certainly must work well.
    I'm clear of the key stuff I have to use:
    -a managed bean, probably containing some list coming from database through dao or o/r mapper.
    -some iterator, e.g. t:dataList (using Tomahawk)
    -h:commandButton with action referring to methods in the managed-bean's elements.
    The question is, what usually would be the scope of the managed-bean.
    If the scope is "request", delete function may work wrong when database changes between the first and the "delete" request.
    -First request: managed-bean created with ids and event handlers.
    -Database changes: new entity is inserted.
    -Secont request: managed-bean created with id-s and event handlers according to the new database content. id-s have been shifted.
    It may help if I override somehow the default id generation of the JSF, by using directly id-s of business entities but I think it's an unproposed hack.
    If the scope of the managed bean is "session", the delete function works well, however we've a lot of stuff to store in the session.
    So, what would be the scope of the managed-bean?
    Or a completely different approach should be used?

    hi,
    faces-config:---------
    <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">
    <!-- ***************Country************-->
    <managed-bean>
    <managed-bean-name>countryMBean</managed-bean-name>
    <managed-bean-class>com.tnhsp.mbeans.CountryMBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    <!-- ***************country************-->
    <navigation-case> <!-- DEfault mode - Fetches all data in datatable -->
    <from-outcome>fetch_country</from-outcome>
    <to-view-id>/hospitalAdmin/country/countryDisplayContent.jsp</to-view-id>
    <redirect/>
    </navigation-case>
    <navigation-case> <!-- Displayes the screen to add data -->
    <from-outcome>add_country</from-outcome>
    <to-view-id>/hospitalAdmin/country/countryCreateContent.jsp</to-view-id>
    <redirect/>
    </navigation-case>
    </faces-config>
    MBEAN:-----
    public class CountryMBean {
    @EJB
    CountrySRemote countrySRemote;
    private Country country = new Country();
    public CountryMBean() {
    System.out.println("countryMBean.countryMBean()");
    country = new Country();
    fc = FacesContext.getCurrentInstance();
    public String actionAdd() {
    renderFlag = 1;
    errorStatus = "";
    System.out.println("countryMBean. - actionadd");
    retValue = "add_country";
    setLinkMode(ADD_MODE");
    setDisableCodeField("false");
    saveStatus = "false";
    listEmptyStatus = "false";
    country = new Country();
    Date dt = new Date();
    country.setEffectFromDt(dt);
    country.setCreatedDate(dt);
    country.setLastUpdatedDate(dt);
    country.setCreatedUser("user");
    country.setLastUpdatedUser("user");
    System.out.print("returning from actionadd");
    return retValue;
    Please help.

  • How to init an application scope backing bean once app server startup?

    Hi guys,
    I got an application scope backing bean but I don't know how to initialize it once the app server startup ! I need all the webpage to be able to get the 'defaultCountry' value once the app server startup !
    <managed-bean>
    <managed-bean-name>applicationScopeBean</managed-bean-name>
    <managed-bean-class>com.borneo.webapp.action.ApplicationScopeBean</managed-bean-class>
    <managed-bean-scope>application</managed-bean-scope>
    <managed-property>
    <property-name>defaultCountry</property-name>
                   <property-class>java.lang.String</property-class>
    <value>Singapore</value>
    </managed-property>
    </managed-bean>
    Pls help, Thanks !
    regards,
    Mark

    write a context listener and set up your web.xml as such
    <listener>
    <listener-class>com.package.ContextListener</listener-class>
    </listener>
    Then your class should inmplement ServletContextListener interface.
    The 2 methods need to be implemented
    public void contextDestroyed(ServletContextEvent sc_event) { }
    public void contextInitialized(ServletContextEvent sc_event) { }
    Hope that helps

  • Bean Scope in dynamic regions

    JDeveloper Version 11.2.1.3.0
    In My Application i have one main URL Invoked Bounded Task flow and i have declared few beans in Pageflowscope in Managed Beans section of Overview tab.
    in this main task flow i have dragged and dropped other task flows as dynamic regions based on the outcome of main task flows tab actions sub task flows will be rendered. i have achieved this task and everything is working fine.
    now i want to access the page flow beans which are declared in main task-flow in this sub dynamic regions.
    how i will get the reference of that main BTF page flow scope bean in the sub-task flow ?
    Regards,
    BK

    Hi,
    you will have to pass the bean as an input parameter to the task flow. Given pageFlowScope is a large scope I suggest you change the bean scope to viewScope because this is all you need. See: http://www.oracle.com/technetwork/issue-archive/2013/13-may/o33adf-1920483.html
    Frank

Maybe you are looking for

  • Total number of license

    Hi, I wanted to know how many license do i have, i am checking the licensing website and i dont see the column where you see the total license you have for a product, can someone please help me. Thanks Abhi

  • Query regarding Name format page for Portugal

    Hi All, We are PeopleTools 8.50 and Peoplesoft HRMS Application 9.0. We have implemented the e recruit module for different countries and I would like to know if a delivered name format page exists for Portugal such as NAME_PRT_SEC because I do not f

  • BPC 5.1 Business Process Flows

    Has anyone experienced a situation where when you kick off a BPF to load data for example recieve an error stating that the package doesn't exist or you don't have rights to run the package?  Using the same login credentials, if I run it directly wit

  • How to create dynamic window in smartform

    <i>HI Floks</i> my requirement is invoice smartform having few line items .i can print this line items with different categories with dynamically placed in smartfom. there how many items with in particular category print its self . how is it possible

  • WRT54GL with Windows Vista

    Greetings, We just bought two Dell E520 computers that will come pre loaded with Windows Vista OS. I also have a WRT54GL router still fresh in the box and un opened. When we receive our new computers we want to use our new WRT54GL. Dose Linksys have