Passing an Arraylist from ApplicationModule to Managed bean

Hi,
We are using the cg$errors package to stack database errors,warnings and informationals. In forms you can see them in messages and we want to see the same message in our ADF application.
I created an pl/sql procedure that returns the messages. In my application module I have created an method that calls the pl/sql-procedure. So far so good.
      try {
         // 1. Create a JDBC PreparedStatement for
         st = getDBTransaction().createCallableStatement( "begin test_rlo.getFeedback(?,?,?);end;", 0 );
         // 2. Define out parameters
         st.registerOutParameter( 1, Types.VARCHAR );
         st.registerOutParameter( 2, Types.VARCHAR );
         st.registerOutParameter( 3, Types.VARCHAR );
         // 3. Execute the statement
         st.executeUpdate();
         // 4. Build return objectsss
         informationArray = stringToArray( st.getString( 1 ) );
         warningArray = stringToArray( st.getString( 2 ) );
         errorArray = stringToArray( st.getString( 3 ) );
         System.out.println("info : "+informationArray.size());
         System.out.println("warn : "+warningArray.size());
         System.out.println("error: "+errorArray.size());
      } catch ( SQLException e ) {
         throw new JboException( e );
      } finally {
         if ( st != null ) {
            try {
               // 5. Close the statement
               st.close();
            } catch ( SQLException e ) {
      }I have some trouble with the last step. Bringing the messages to my adf-page.
I have created the method as an action in the PageDef.
    <methodAction id="getDBFeedback"
                  InstanceName="RelatieAppServiceDataControl.dataProvider"
                  DataControl="RelatieAppServiceDataControl"
                  MethodName="getDBFeedback" RequiresUpdateModel="true"
                  Action="999" IsViewObjectMethod="false">
      <NamedData NDName="informationArray"
                 NDValue="${DBFeedbackBean.informationArray}"
                 NDType="java.util.ArrayList"/>
      <NamedData NDName="warningArray" NDValue="${DBFeedbackBean.warningArray}"
                 NDType="java.util.ArrayList"/>
      <NamedData NDName="errorArray" NDValue="${DBFeedbackBean.errorArray}"
                 NDType="java.util.ArrayList"/>
    </methodAction>I created an managed-bean(DBFeedbackBean) on the request scope. In my managed-bean I defined three arraylists (warning,information and error) .
In the constructor I execute the method action:
      DCBindingContainer bindings = getCurrentBindingContainer();
      OperationBinding operationBinding = ( OperationBinding )bindings.getOperationBinding( "getDBFeedback" );
      operationBinding.getParamsMap().put("informationArray", informationArray);
      operationBinding.getParamsMap().put("warningArray", warningArray);
      operationBinding.getParamsMap().put("errorArray", errorArray); 
      operationBinding.execute();Within the application module I can log several informationals,warnings and errors but the arrays stay empty.
What am I missing here?
Regards,
Romano

Hi,
this is similar to what you are trying to do:
AM Method
    public String[] syncBudgetAmounts(Double allocationId){
        getDBTransaction().commit();     
        String result = new String();
        String message = new String();
        try  {
            String sql = "call plus_budget.sync_budget_amounts(?,?,?,?)";
            CallableStatement stmt = getDBTransaction().createCallableStatement(sql, 0);
            stmt = getDBTransaction().createCallableStatement(sql, 0);
            stmt.setDouble(1, allocationId);
            stmt.setString(2, getUserName());
            stmt.registerOutParameter(3,Types.VARCHAR);
            stmt.registerOutParameter(4,Types.VARCHAR);
            stmt.execute();
            result = stmt.getString(3);
            message = stmt.getString(4);
            stmt.close();
            getBudgetAllocationsView1().executeQuery();
        } catch (Exception ex)  {
            result = "Error";
            message = ex.getMessage();
            ex.printStackTrace();
        return new String[]{result, message};
    }pageDef:
<methodAction id="syncBudgetAmounts"
                  InstanceName="BudgetAdminServiceDataControl.dataProvider"
                  DataControl="BudgetAdminServiceDataControl"
                  MethodName="syncBudgetAmounts" RequiresUpdateModel="true"
                  Action="999" IsViewObjectMethod="false"
                  ReturnName="BudgetAdminServiceDataControl.methodResults.BudgetAdminServiceDataControl_dataProvider_syncBudgetAmounts_result">
        <NamedData NDName="allocationId" NDValue="#{row.AllocationId}" NDType="java.lang.Double"/>
    </methodAction>Page:
<afh:rowLayout rendered="#{bindings.syncBudgetAmounts.result[0] != null}"
                             width="90%">
                <afh:cellFormat halign="right">
                  <af:objectImage source="/images/info_lh.gif"
                                  inlineStyle="vertical-align:middle; margin:1.0pt;"
                                  rendered="#{bindings.syncBudgetAmounts.result[0] == 'Success'}"/>
                  <af:objectIcon name="error"
                                 rendered="#{bindings.syncBudgetAmounts.result[0] == 'Error'}"/>
                  <af:objectSpacer width="5" height="10"/>
                  <af:outputText value="#{bindings.syncBudgetAmounts.result[0]} : #{bindings.syncBudgetAmounts.result[1]}"
                                 styleClass="x3s"
                                 inlineStyle="font-size:smaller;"/>
                </afh:cellFormat>
              </afh:rowLayout>Brenden

Similar Messages

  • Passing memory settings from the Node Manager to the Managed Server

    All,
    I am trying to start a Managed server from the Node Manager. The configuration is as follows:
    I have a domain with two managed servers(M1, M2). I could start both of them using the shell scripts without any problems. Both of the servers has custom memory settings -Xms3072m -Xmx3072m -XX:PermSize=256m
    to facilitate deployment and effective operation of managed servers (the applications being deployed are kind of large).
    Now, I am trying to start the same two servers using Admin Console:
    In the admin console: I created a Unix Machine(U1) assigned the managed servers (M1, M2) to U1. I started the Node Manager on U1.
    When I try to start a Managed Server from console, the server is starting but the memory settings (-Xms3072m -Xmx3072m -XX:PermSize=256m ) are not passed to the managed server startup, so the application deployment is failing with out of Memory errors. I tried to assign same memory settings to Node manager assuming it will pass on that configuration to the node manager without any luck.
    Any help is appreciated.
    Thanks
    Raj

    Starting Managed Server from Node Manager

  • How can I pass an ArrayList from a JavaBean to my JSP ?

    Hi,
    I have developed a java bean that gets info from a database in the form of an ArrayList called values.
    private ArrayList values = new ArrayList();I have a method in the bean that returns this ArrayList
    public ArrayList getValues() {
        try {
          ResultSetMetaData meta = rs.getMetaData();
          while (rs.next()) {
            for (int i = 0; i < meta.getColumnCount(); i++) {
              Object ob = rs.getObject(i + 1);
              if (rs.wasNull()) {
                ob = null;
              keys.add(meta.getColumnLabel(i + 1));
              values.add(ob);
        catch (Exception ex) {
          System.err.println("Error");
        return values;
      }I am new to this and am confused as to how to get my ArrayList back on a page that uses my bean.
    I can get it as a String on my jsp page that uses the bean
    <%= testBeanId.getValues() %>
           <%=this.toString() %>but that's not really what I want. If I try and use a for loop to go through values
    for(int i = 0; i < values.size();i++){
        out.println (values.get(i));
    }it complains that it cannot find values.
    Any ideas ? I am really new to this, so any help is appreciated.

    put the arraylist in the session and get it in the jsp.
    session.setAttribute("apps",values);
              ArrayList dataProfile = (ArrayList)session.getAttribute("apps");
              for(int j = 0; j < dataProfile.size(); j++)
              ApplBean app = (ApplBean)dataProfile.get(j);
              String app = null;
              if (app.getAppName() != null) {
                   app = app.getAppName();
              }

  • Howto: Iterate ADF BC from a managed bean from the View?

    Hi Everyone,
    I've been trying to iterate a BC ADF object from a managed bean from the view layer. Here is what I have done so far, but I don't seem to get any records:
    In faces-config.xml, I am passing in the BindingContext to the managed bean. (This is a session scoped bean).
    <managed-property>
          <property-name>bindings</property-name>
          <property-class>oracle.adf.model.BindingContext</property-class>
          <value>#{data}</value>
        </managed-property>In the testPageDef.xml I have the executables and bindings setup:
      <executables>
        <iterator id="TestRO1Iterator" RangeSize="-1" Binds="TestRO1"
                  DataControl="ApplicationControlDataControl"/>
      </executables>
      <bindings>
        <table id="TestRO1" IterBinding="TestRO1Iterator">
          <AttrNames>
            <Item Value="C1"/>
            <Item Value="C2"/>
          </AttrNames>
        </table>
    </bindings>In my managed bean, in addition to the accessors for the bindingContext of bindings, I have:
                 BindingContainer bc = getBindings().findBindingContainer("testPageDef");
                 ControlBinding cb = bc.getControlBinding("TestRO1");
                 RangeBinding rb = (RangeBinding)cb;
                 List testList = rb.getRangeSet();
                 Iterator testIter = testList.iterator();
                 int testCount = testList.size();
                 while (testIter.hasNext()) {
                   Map attrs = (Map)testIter.next();
                   System.out.println(attrs.get("C1")+","+attrs.get("C2"));     
                   //Do some fancy stuff here with the values.
                 }However, my testList.size() always returns 0.
    Is this the right method to programatically access the data from the view layer from a managed bean, or have I missed something completely? Are there any working samples that I could take a look at?
    Jdev: 10.1.3.1
    Thanks!
    Kenton

    Hi,
    <managed-property>
    <property-name>bindings</property-name>
    <value>#{bindings}</value>
    </managed-property>
    private BindingContainer bindings= null;
    public void setBindings(BindingContainer bc){
    bindings = bc;
    public BindingContainer getBindingContainer(){
    return bindings;
    DCIteratorBinding dciter = (DCIteratorBinding ) bc.get("TestRO1Iterator");
    RowSetIterator rsi = dciter.getRowSetIterator();
    while (rsi.hasNext()){
    Row rw = (Row) rsi.next();
    //Do some fancy stuff here with the values.
    You find several examples in the developer guide and on the Internet
    Frank

  • How to call partial trigger on JSFF component from separate managed bean?

    Guys and Gals,
    Using JDev 11.1.1.2.0. Looked on the forums and google. Initial results aren't so great.
    Is it possible to call a PPR on a JSFF component from a separate managed bean? It seems calling the FacesContext in this instance calls the root JSPX, which only contains one child: the RichDocument.
          UIComponent component =
             FacesContext.getCurrentInstance().getViewRoot().findComponent("pc1:table1");
          if (component != null)
             AdfFacesContext context = AdfFacesContext.getCurrentInstance();
             context.addPartialTarget(component);
          System.out.println(FacesContext.getCurrentInstance().getViewRoot().getChildCount());Returns 1 :(
    Ideas for a workaround?
    Edited by: LovettWB on Nov 17, 2010 3:39 AM
    Edited by: LovettWB on Nov 17, 2010 4:11 AM
    Edited by: LovettWB on Nov 17, 2010 4:12 AM

    Thanks! Joonas, you've been a great help.
    The code on the page you referenced was close, but the code on a page referenced in the user comments was even better:
    http://www.jroller.com/mert/entry/how_to_find_a_uicomponent
    My region is located in a facet, which the page you posted doesn't quite cover, but the page above fixed that. Here's the fix below:
    In Managed Bean
          // search for the region ID (or task flow) in the base page
          UIComponent base = jsfUtils.findComponentInRoot("dynamicRegion");
          // now find component ID from within that region
          UIComponent partTable = jsfUtils.findComponent(base, "partTable");
          // call PPR on your found component
          AdfFacesContext.getCurrentInstance().addPartialTarget(partTable);In JSFUtils utility class
       // used to locate region.  Could also find any component
       // located in the base ViewRoot()
       public static UIComponent findComponentInRoot(String id) {
        UIComponent component = null;
        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (facesContext != null) {
          UIComponent root = facesContext.getViewRoot();
          component = findComponent(root, id);
        return component;
        // Recursive method which finds your component within JSFF
        // regardless of facet or other UIComponents which may have children
    public static UIComponent findComponent(UIComponent base, String id) {
        if (id.equals(base.getId()))
          return base;
        UIComponent kid = null;
        UIComponent result = null;
        Iterator kids = base.getFacetsAndChildren();
        while (kids.hasNext() && (result == null)) {
          kid = (UIComponent) kids.next();
          if (id.equals(kid.getId())) {
            result = kid;
            break;
          result = findComponent(kid, id);
          if (result != null) {
            break;
        return result;
    }Good stuff to know!

  • How to programmatically Identify the Phase from a managed bean

    How can we identify the Phase from a normal managed bean method ?
    This managed bean method is a method activity in a task-flow. How can we identify the phase..?
    If there is an event then, we can identify the phase using event.getPhaseId() but here there is no event. Can I get the phase programmatically ?
    Thanks

    Hi,
    You won't need that with a PhaseListener. You could use something like the following:
    public class CurrentPhaseListener implements PhaseListener
        private static ThreadLocal<PhaseId> currentPhaseId = new ThreadLocal<PhaseId>();
        public static PhaseId getCurrentPhaseId()
            return currentPhaseId.get();
        public void afterPhase(PhaseEvent ev)
            currentPhaseId.remove();
        public void beforePhase(PhaseEvent ev)
            currentPhaseId.set(ev.getPhaseId());
        public PhaseId getPhaseId()
            return PhaseId.ANY_PHASE;
    }Regards,
    ~ Simon

  • Creation of a Managed Bean in Request Scope?

    Is there an easy way to create an instance of a managed bean (configured in faces-config.xml) that was configured to be in the Request scope?
    If a JSP refers to it by id, then it will be there.
    However, when the JSP does not refer to it, it will not be in the request. I find I need to generate it anyway to use it from within another Managed Bean. I can extract out the faces-config information from the application map (available from FacesContext) and build it manually -- but this ties me to a particular JSF implementation (and probably version, too).
    Is there a more standardized way to do this?
    Thanks,
    ken

    BTW -- I mean to do this from within Java code (not jsp), and the page being rendered does not have a direct reference to the request-scoped managed bean via value binding.

  • How to access backing bean of a xml component , in a managed bean of ADF

    Hi,
    We wrote a xml component in JSF and this component is used in ADF project by including the component as jar .
    In a master detail page , we need to update the value of the xml component, when the master row is changed. How to do this.
    We are trying to do this by accessing the backing bean of the xml component in ADF project's managed bean. So when ever the row changes, we can access the managed bean in ADF and then can set the value of the xml component by accessing it's backing bean
    But i can't access the backing bean instance of the xml component in the ADF managed bean. Could you let me know how to do this. Thanks .

    Thanks for the response Shay. The xml component is added as a custom component , with a separate faces-config.xml file . This component is added to ADF project as a jar with a custom tag.
    In the ADF project , i'm having different managed beans and i can access them from a different managed bean.
    The issue is, i can't access the added custom component's backing bean which is available from a different jar , defined in a separate faces-config.xml file . This backing bean is defined with request scope.

  • @EJB annotation in JSF managed beans not working

    Hi all,
    I've been trying to get the @EJB annotation to work in a JSF manged bean without success.
    The EJB interface is extremely simple:
    package model;
    import javax.ejb.Local;
    @Local
    public interface myEJBLocal {
    String getHelloWorld();
    void setHelloWorld(String helloWorld);
    and the bean code is simply:
    package model;
    import javax.ejb.Stateless;
    @Stateless
    public class myEJBBean implements myEJBLocal {
    public String helloWorld;
    public myEJBBean() {
    setHelloWorld("Hello World from myEJBBean!");
    public String getHelloWorld() {
    return helloWorld;
    public void setHelloWorld(String helloWorld) {
    this.helloWorld = helloWorld;
    When I try to use the above EJB in a managed bean, I only get a NullPointerException when oc4j tries to instantiate my managed bean. The managed bean looks like:
    package view.backing;
    import javax.ejb.EJB;
    import model.myEJBLocal;
    import model.myEJBBean;
    public class Hello {
    @EJB
    private static myEJBLocal myBean;
    private String helloWorld;
    private String helloWorldFromBean;
    public Hello() {
    helloWorld = "Hello from view.backing.Hello!";
    helloWorldFromBean = myBean.getHelloWorld();
    public String getHelloWorld() {
    return helloWorld;
    public void setHelloWorld(String helloWorld) {
    this.helloWorld = helloWorld;
    public String getHelloWorldFromBean() {
    return helloWorldFromBean;
    Am I missing something fundamentally here? Aren't you supposed to be able to use an EJB from a JSF managed bean?
    Thanks,
    Erik

    Well, the more I research this issue, the more confused I get. There have been a couple of threads discussing this already, and in this one Debu Panda states that:
    "Support of injection in JSF managed bean is part of JSF 1.1 and OC4J 10.1.3.1 does not support JSF 1.1"
    10.1.3.1 Looking up a session EJB with DI from the Web tier
    But if you look in the release notes for Oracle Application Server 10g R3, it is explicitly stated that JSF 1.1. is supported. So I'm not sure what to believe.
    I've also tried changing the version in web.xml as described here:
    http://forums.java.net/jive/thread.jspa?threadID=2117
    but that didn't help either.
    I've filed a SR on Metalink for this, but haven't got any response yet.
    Regards,
    Erik

  • How to pass a value from jspx page to the managed bean

    hi,
    i have created a jspx page and manages bean with page flow scope..
    in my jspx page i am searching a employee record from the data base . and getting entire employee details including 'status' as a search result.
    here i want to pass the value of 'status ' field to the managed bean variable called 'stval'.
    can anybody suggest any solution?.......

    As per the details provided in the post above, when the user clicks on the search in the af:query, the results are populated in the table. And you are interested in getting the value of particular column. This could be done by having the custom row selection listener to get the value of the current row (selected row in the table).
    1) Have a custom selection listener:
    <af:table value="#{bindings.EmpDeptVO.collectionModel}" var="row"
    rows="#{bindings.EmpDeptVO.rangeSize}"
    emptyText="#{bindings.EmpDeptVO.viewable ? 'No data to display.' : 'Access Denied.'}"
    fetchSize="#{bindings.EmpDeptVO.rangeSize}"
    rowBandingInterval="0"
    rowSelection="single" id="t1"
    partialTriggers=":::qryId1 ::ctb1 ::commandToolbarButton1"
    columnStretching="column:c1"
    styleClass="AFStretchWidth" columnSelection="multiple"
    first="0" contentDelivery="immediate" autoHeightRows="10"
    binding="#{pageFlowScope.ExampleBean.searchResultsTable}"
    *selectionListener="#{pageFlowScope.ExampleBean.rowSelected}">*
    2) In the method, set the current row programmatically:
    ADFUtil.invokeEL("#{bindings.EmpDeptVO.collectionModel.makeCurrent}",
    new Class[] { SelectionEvent.class },
    new Object[] { selectionEvent });
    3) Get the current row and get the required attribute values and set it in any of the variables in the managed bean:
    Row selectedRow =
    (Row)ADFUtil.evaluateEL("#{bindings.EmpDeptVOIterator.currentRow}");
    String status = selectedRow.getAttribute("Status");
    Thanks,
    Navaneeth

  • How to get iterator values from a managed bean ?

    Due to a bug in selectOneChoice i'm not able to get the label list i want to display directly from an iterator when the value binding is a managed bean.
    To solve the problem i would like to create a managed bean that contains that list and use it as the selectItems to display.
    I would like that the values in that managed bean loaded from the a data control iterator.
    My question is :
    1) is it possible to access the iterator values from a managed bean, i mean without any reference to a page definition
    2) how to do ? is it documented somewhere ? any example ?
    Thank you

    I got it also with this code:
    package view.managedBeans;
    import classification.bean.ClassificationDocument;
    import classification.castor.ClassificationLanguage;
    import java.io.FileNotFoundException;
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.List;
    import java.util.Locale;
    import javax.faces.context.FacesContext;
    import javax.faces.el.ValueBinding;
    import javax.faces.model.SelectItem;
    import oracle.adf.model.generic.DCGenericDataControl;
    import org.exolab.castor.xml.MarshalException;
    import org.exolab.castor.xml.ValidationException;
    public class ClassificationLanguageList {
    private java.util.List<SelectItem> supportedLanguages = new ArrayList();
    public ClassificationLanguageList() throws FileNotFoundException,
    MarshalException,
    ValidationException {
    FacesContext ctx = FacesContext.getCurrentInstance();
    ValueBinding vb = ctx.getApplication().createValueBinding("#{data.ClassificationDocumentDataControl}");
    DCGenericDataControl classificationDocumentDataControl = (DCGenericDataControl)vb.getValue(ctx);
    ClassificationDocument classificationDocument = (ClassificationDocument)classificationDocumentDataControl.getDataProvider();
    ClassificationLanguage[] classificationLanguage = classificationDocument.getClassification().getClassificationLanguageList().getClassificationLanguage();
    for (int counter = 1; counter < classificationLanguage.length; counter++) {
    SelectItem language = new SelectItem();
    language.setValue(classificationLanguage[counter].getClassificationLanguageCode());
    language.setLabel(classificationLanguage[counter].getClassificationLanguageLabel());
    supportedLanguages.add(language);
    public void setSupportedLanguages(java.util.List<SelectItem> supportedLanguages) {
    this.supportedLanguages = supportedLanguages;
    public java.util.List<SelectItem> getSupportedLanguages() {
    return supportedLanguages;
    }

  • How to call a AM method with parameters from Managed Bean?

    Hi Everyone,
    I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
    Class[] paramTypes = { };
    Object[] params = { } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
    String aVal = "test";
    Class[] paramTypes = {String.class };
    Object[] params = {aVal } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
    Thanks,
    San.

    Simply do the following
    1- Make your Method in Client Interface.
    2- Add it to Page Def.
    3- Customize your Script Like the below one to Achieve your goal.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap().put("username", "oracle");
    operationBinding.getParamsMap().put("role", "F1211");
    operationBinding.getParamsMap().put("Connection", "JDBC");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    i hope it help you
    thanks

  • How to pass js variable to be used in managed bean constractor?

    Hi,
    I got a list of items that i present in <h:selectOneMenu on my page (the first page the user sees)
    the labels that are shown in the ><h:selectOneMenu are date + time , and the time itself is stored in the db in UTC without any + or - timezone offset (e.g UTC +2)
    In order to show the correct time in the labels of the ><h:selectOneMenu I'm adding the needed offset of the user timezone
    the problem is that the ><h:selectOneMenu is being populated from the managed bean before I'm passing the offset from the xhtml page itself using jQuery $.post(
    like this
    <h:head>
    <script type="text/javascript">
              jQuery(document).ready(function($) {
                   d = new Date();
                   var tz = -1 * d.getTimezoneOffset()/60;
                   $.post("/servlets/TimeZoneFromClientServlet",{timezone : tz});
           </script>
         </h:head>any ideas how can i pass the TimezoneOffset to the application before the managed bean is loaded?
    Thanks ahead!
    Daniel.

    You know, any website I've encountered so far ASKS for your timezone. Why do you think that is?
    In any case, if you really want to go ahead and do what you want, you need a single point of entry in your web application that sets the timezone in the session once so you can reuse it. It could be something as simple as doing it in a login page if you have one; just create a hidden input field that is prefilled with the timezone you find using Javascript; then simply submit it to the server and stick it in the session there. When the session times out the user would have to login again, which would give you the timezone value back.
    another option: is the managed bean session scoped? If so you can simply fetch it in your servlet and update the appropriate property of the managed bean. This one makes me feel some shame for suggesting it though.

  • Issue with passing parameters from JSP to Backing bean

    hi ,
    I have an issue in passing parameters from my JSP to backing bean. I want to fetch the parameter from my URL in backing bean .This is how i am coding it right now. But the parameter companyID returns me null.
    URL http://localhost:8080/admin/compadmin.jsp?companyID=B1234.
    In my backing bean
    FacesContext context = FacesContext.getCurrentInstance();
    String companyID = (String)context.getExternalContext().getRequestParameterMap().get("CompanyID");
         public void setCompanyID(String companyID)
              this.companyID=companyID;
         public String getCompanyID()
              return this.companyID;
    faces-config.xml :
       <managed-bean-name>admincontroller</managed-bean-name>
              <managed-bean-class>com.admin.controller.AdminController</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <property-name>companyadminbean</property-name>
                   <property-class>com.admin.model.AdminBean</property-class>
                   <value>#{companyadminbean}</value>
                         </managed-property>
                        <managed-property>
                                 <property-name>companyID</property-name>
                              <value>#{param.companyID}</value>
                             </managed-property>Please let me know if iam missing something.Appreciate your help in advance
    Thanks

    Thanks very much for your input. I made changes to my bean accordingly. Actually the method getAdminType() is a not a getter of a property. It's just a method which iam calling in AdminController bean constructor to verify whether the person is System Admin or Client admin. So now the issue is inspite of making changes still the link "Copy Users" shows up for Client admin too which is incorrect.
    My Administrator bean:
    public class Administrator {
      boolean GSA=false;
      boolean SA=false;
      public Administrator(){}
    public boolean isGSA()
        return GSA;
      public boolean isSA()
        return SA;
      public void setGSA(boolean value)
        this.GSA=value;
      public void setSA(boolean value)
        this.SA=value;
    }My backing bean:
    public class AdminController {
    private AdminBean adminbean = new AdminBean();
    public AdminController(){
    int userID=1234;
    this.getAdminType(userID);           
    public void getAdminType(int userID)
             Administrator admin = new Administrator();
             if (userID<0) return;
             try{
                 if(Rc.isGlobalSystemAdmin(userID)){
                      admin.setGSA(true);
                              }else if(Rc.isClientSystemAdmin(userID)){
                      admin.setSA(true); // i could see these values setup correctly in the admin bean when i print them
                 adminbean.setAdmin(admin);
                  } catch (Exception e){ }
    Admin Bean:
    public class AdminBean {
    private Administrator admin; 
    public Administrator getAdmin()
                        return this.admin;
              public void setAdmin(Administrator admin)
                        this.admin = admin;
    faces-config.xml
    <managed-bean>
              <managed-bean-name>admincontroller</managed-bean-name>
              <managed-bean-class>com.controller.AdminController</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <property-name>adminbean</property-name>
                   <property-class>com.model.AdminBean</property-class>
                   <value>#{adminbean}</value>
             </managed-property>
         </managed-bean>
         <managed-bean>
              <managed-bean-name>adminbean</managed-bean-name>
              <managed-bean-class>com.model.AdminBean</managed-bean-class>
              <managed-bean-scope>request</managed-bean-scope>
              <managed-property>
                   <managed-property>
                   <property-name>admin</property-name>
                   <property-class>com.model.Administrator</property-class>
                   <value>#{admin}</value>
                             </managed-property>
         </managed-bean>     My JSP:<h:outputLink id="ol1" value="/companyadmin/copyusers.jsp">
               <h:outputText id="ot1" value="Copy Users" rendered="#{adminbean.admin.isGSA}" /><f:verbatim><br/></f:verbatim>
               </h:outputLink>    so now the issue is thelink copy users is displayed even #{adminbean.admin.isGSA} is FALSE. please advise.
    Thanks
    Edited by: twisai on Oct 15, 2009 7:06 AM

  • Can I create a Managed bean myself and pass it to JSF?

    Hi,
    Is it possible to create a managed bean in my code and pass it to JSF. I basically want JSF to take care of the data transfer from the request to the bean but I want to create and load the bean myself.
    If that's possible would you mind leaving me some code example on how to pass it to JSF.
    P.S.: I know that a managed bean is essentially an ordinary bean configure in the faces-config.xml as a managed bean. :)
    Thx

    (1)Why do you need manual instantiation of the 'managed' bean?I know such a case.
    Suppose you already have an EJB application and want to use JSP to display the result of the EJB call which is returned as a JavaBean.
    One solution is put your bean to SessionMap with the name specified in faces-config.xml.
    FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("name", bean);
    But, I hate this solution because it hard-codes the name of the bean.
    My favorite solution is to provide the result bean as a property of another managed bean.
    public class ManagedBean {
        private ResultBean result;
        public ResultBean getResult()  {return result;}
        public String action() {
            result = /* call EJB */;
             return "ok";
    }Page authors can refer the result bean as #{managedBean.result}.

Maybe you are looking for

  • SSO2KerbMap error

    Hello, I am trying to implement the SSO2KerbMap module on the IIS for SSO for .NET applications. When I use the SSO2KerbMap module with an application I receive this specific error at it's log files: 17:10:11 1644/5812 E LogonAsUser: LsaLogonUser fai

  • Codec

    What the correct codec for Final Cut Pro?

  • Music and photos from Droid to Iphone4?

    I recently switched from Droid Incredible to Iphone 4, and I don't know how to get music and pictures transfered over. Can someone please help?? Verizon store told me to sync to iTunes, but didn't get an explanation of how...

  • Maximizing ram use

    Hi. I have a Mac Pro 5,1 quad core 2.8ghz mid 2010. I purchased 16 gb of ram from Macsales.com. I use Photoshop and other applications in Adobe Creative Suite CS 5 Professional, iphoto, imovie, Final Cut Express 4.0, and Roxio Toast Titanium (for bur

  • Impossible d'installer iTunes  11.1.2 sur mac os 10.8.5

    Une erreur est survenue lors du téléchargement des mises à jour.(102) il s'agit de itunes 11.1.1 ou 11.1.2 sur mac os 10.8.5 merci de votre aide .