Share data between managed beans

I used Sun Studio Creator for jsf before
and there I can create a class extending AbstractSessionBean
which had a function named getBean(String beanName)
If this bean is in session scope, it could get any managed bean
in session or in application scope and access those properties.
But that facility is for studio creator only.
How can I access a property of a managed bean from another managed bean, if both are in session scope?

ok I found the solution in
http://forum.java.sun.com/thread.jspa?threadID=596776

Similar Messages

  • How can I share data between two forms on different lists

    Using a custom content type, I created two lists that I want to share the same data - one is a calendar.  Our employees complete a form from the "Out of Office Request" list that has workflow functionality that sends an email to that person's
    manager.  If the manager approves the request, the item automatically populates the "Out of Office Calendar."  The problem is that the only information from the request list that populates the calendar is the Title field and date/time fields. 
    I need the manager name in order to create a view for each manager.  
    How can I connect the other information in the request list to the calendar list.  It seems to me that if the title and date fields carry over the information, there should be a way to connect the other information.  I'm using Designer.
    I've tried to connect the two lists' webparts with the wizard, but when I get to the page that maps the two lists, there are no column names and the "Next >" button is grayed out.  This seems like the logical place to connect the two lists,
    but it isn't working.

    Hi,
    According to your post, my understanding is that you wanted share data between two forms on different lists.
    To show external  information on the calendar event, there are two methods: Calculated column, workflow. You can refer to:
    A Simple Guide to Show More Information on a Calendar Event
    I recommend to use workflow to achieve what you want. But you need to create a people column to display the manager.
    You can create a workflow associated to the "Out of Office Request" list, add action to Start Approve Process. If the manager approves the request, you can create a item in the calendar, and then update the people column and the title column.
    Then the calendar will display the Title, date/time and the manager.
    To create a view for each manager, you need to modify the Filter. You can use the people column is equal to the manager name or the Title contains the manager name.
    Thank you for your understanding.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • What is difference between Managed Bean and Backing Bean?

    What is difference between Managed Bean and Backing Bean? Please guide me how to create them and when to use them?
    Please post sample for both beans.

    Hi,
    managed beans and backing beans are quite the same in that the Java object is managed by the JavaServer Faces framework. Manage in this respect means instantiation. The difference is that backing beans contain component "binding" references, which managed beans usually don't. Do backing beans are page specific versions of managed beans.
    Managed beans are configured either in the faces-config.xml file, or using ADF Faces and ADFc, in the adfc-config.xml file
    Frank
    Edited by: Frank Nimphius on Jan 31, 2011 8:49 AM

  • How do I share data between my MBP and iMac?

    I have two Genealogy programs on my iMac that I would like to share data between my MBP and the iMac.  I would like to gather the data on the MBP and then share new data to the iMac which is where I basically do all of the Genealogy work from, since it is much easier with the larger screen and better keyboard. 
    Can someone please explain or direct me to a tutorial or procedures if this is possible?  Thank You!

    Click Apple>System Preferences>Sharing
    Check File Sharing. In File Sharing add the folder you want to share with another computer. Then add users. Then proide access previledges such as Read & Write, Read Only, Write Only or No Access.
    Now in the System Preferences, Click iCloud, sign in to iCloud. It's free and you can access your Macs from anywhere.
    In iCloud, check Back to My Mac.
    Do the same to another computer. You're all set by now.

  • Share data between built exe:s.

    Hello.
    How do I share data between two built exe:s ? I now use a global variable between two VI:s and it works exactly as I want. However, when I build the application
    the communication between the two exe:s is lost.
    All help appreciated. Real examples are really appreciated to.
    Regards
    Andreas

    Hi Andreas
    If you have an application, it allocates memory. All global variables are located in this memory. The same happens for the second application.
    So that's why it doesn't work. If you have to vis and start them with LV, they both are running in the memory range of LV.
    One way to solve your problem is some kind of client-server architecture. You could have a third application which acts as a data-server and the other two apps act as data-clients.
    Hope this helps.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...

  • How can I share data between WinXP Pro and Mac OS 10.8.3 via wifi

    How can I share data between WinXP Pro and Mac OS 10.8.3 via home wifi. 

    MartyP wrote:
    Or is there a problem with both OS's writing stuff to the
    ~/Home/Library folder that may be incompatible?
    Yes, big time.  Mail, for sure, has a different file/folder structure, and would not be happy.
    Plus, a number of apps (Apple and 3rd-party) are "Sandboxed."  That's a security feature, to prevent malware or bad coding from affecting things it shouldn't.  Some of their files, including the preferences files, aren't even stored in the same places!
    Or to other places I'm not aware of?
    Probably.  If you have two versions of the same app, they may or may not expect the same data setup.
    To have one User folder for both OS's would save a lot of drive space
    Not if you use some or all of woodmeister50's suggestions. 
    But I'm also not sure how I'd use Time machine with such a set up.
    Just as you do now.  By default, Time Machine backs-up everything (except things like system work files, most caches and logs, trash) for all users and all internal drives & partitions.  By default, it excludes external drives.
    You can change those defaults, of course, via TM Preferences > Options.
    See Time Machine - Frequently Asked Question #32 for details and considerations of multiple drives.
    Presently I backup with . . . clones to other HD's
    Good.   Yes, clones are different.  You need multiple "tasks" to back up multiple drives/partitions.  But once set up, that shouldn't be a big deal.

  • How to share data between applications.

    I'm trying to share data between LabVIEW v6.0 and another program (16 bit), both running on Windows95. At first DLL's seemed to be the answer but I would need to call 16 bit DLL's which I understand can be a problem. With my limited knowledge of C++ I've written a program (Borland C++4.2) which can access the data I need and save it to a file, this is then repeatedly read by LabVIEW, crude but it works. When I add code to do the same the other way I get occasional file sharing errors. I can't get either LabVIEW or C++ to trap these errors. As an alternative I thought I could write and read to a reserved portion of memory (less than 1K should be enough) using in port and out port. Is this viable, and if so how do I
    reserve the memory in Windows 95 so that LabVIEW & my C++ program can access it?
    Any suggestions?

    Ian wrote:
    > I'm trying to share data between LabVIEW v6.0 and another program (16
    > bit), both running on Windows95. At first DLL's seemed to be the
    > answer but I would need to call 16 bit DLL's which I understand can be
    > a problem. With my limited knowledge of C++ I've written a program
    > (Borland C++4.2) which can access the data I need and save it to a
    > file, this is then repeatedly read by LabVIEW, crude but it works.
    > When I add code to do the same the other way I get occasional file
    > sharing errors. I can't get either LabVIEW or C++ to trap these
    > errors. As an alternative I thought I could write and read to a
    > reserved portion of memory (less than 1K should be enough) using in
    > port and out port. Is this viable, and if so how do I reserve the
    > memory in Windows 95 so that LabVIEW & my C++ program can access it?
    >
    > Any suggestions?
    May be TCP/IP or UDP interprocess communication will do? It shouldn't be
    a problem via localhost. You can try separate VI server to handle
    communication task from your vi with C++ socket.
    Sergey Krasnishov
    Automated Control Systems
    National Instruments Alliance Member
    Moscow, Russia
    [email protected]
    http://acs.levsha.ru

  • How can share data between jsp pages using beans??

    any one can give me code for 2 jsp pages with bean that share data for them

    <jsp:usebean name="yourBeanName" type="com.whatever.foo" scope="session"/>
    this will look for a bean named yourBeanName in the scope specified by the scope attribute. If none was found, the container will instantiate one with the no arg constructor for your bean and place it into the proper scope.
    if your bean had a method getName(), you could then on your jsp do:
    <%=yourBeanName.getName()%> to print the results of the method to the page. there are other ways to do the actual placing of the output on the page, but this is the most direct.

  • How can I load the data of Manager Beans into an Array?

    Hi all!
    I have a problem when use the ADF model layer (JDeveloper 10g). I want to load the data of a Manager Bean into Array(such as: Array in JavaScript).But I don't know any ways to do.
    Are there any ways to do that?
    Please, help me!
    Thanks so much!

    Hi,
    there is a fundamental difference between an array in Java and an array in JavaScript as the latter is added to the output page while the first sits in a Java class on the server.
    Populating a Java array from a managed bean is straight froward: Just create the Array, loop through the source of the data - ADF binding or the ADF Faces table component - and fill it.
    For a JavaScript Array I would suggest to write the array into a js file and reference it from the web page (which might cause concurrency issues).
    Frank

  • Using events (?) to share data between tab pages

    I don't know whether this is an event question or an Object-Oriented design question or a JTabbedPane question.
    I'm pretty new to Java, so be patient!
    I wish to have a JTabbedPane with a tab to do 'Import' of data, and a tab to do 'Export' of data (the SAME data which was imported). Now, how do I share the data between the 2 tabs?
    It seems the data belongs at the JFrame level, but then how does the data in each tab access it? In other languages I would pass a reference to the data object in the window to each tab.
    Or how do I get (or set) the data when the tab changes? And how do I know when the tab changes?
    I think I need to set trigger some sort of event to the parent window, who I suppose has a listener, and then it can then query the appropriate pane? If so, I'm not sure what sort of event trigger I should be using, where etc.
    I know if I had one tab with an import/export functionality then I could declare the Collection within that panel.
    Help!!!
    Thanks ;)

    I think this is an OO design question.
    You basically have two views (the two panes) of the same data. So I'd suggest the Observer pattern (see the Design Patterns book) where one model holds the data and the model is observed by several views.

  • Global variables to share data between separate programs.

    Hi guys and gals,
    On the advice of a lv consultant, we've used an array of global
    variables to share data (about 100 variables) between an acquisition/control
    program and a consumer program (datalogging) running on the same PC. This
    worked fine in the development environment. However it no longer works when
    the two programs are compiled. Is there a trick to get this to work or do
    we have to use datasockets or DDE to move the data.
    In case you're wondering the idea of two separate programs is to
    separate the critical control and data acquisition functions from the less
    critical but more likely to error datalogging functions.
    Regards,
    Alf Katz,
    [email protected]

    There are several solutions:
    1.) Use VI Server available in LabVIEW 5.1 and Up to provide a communication
    path between the two executables.
    2.) Use a data file to transfer the data between the two executables.
    3.) Use a TCP/IP connection there are several examples included with LabVIEW
    showing the mechanics of this.
    The simplest method is Number 1. Using the VI server, you open the
    connection and then retrieve the data form the Global VI based on the
    Parameter Name. It is very fast and requires very little processor
    overhead. Make a driver to Open the connection then a Read to get the data.
    Do not open and close the connection everytime, there is a lot of overhead
    in the Open connection call.
    Make sure you configure the VI Server within the development environmen
    t.
    Also you must include a few statements in the Executables INI file to
    correctly enable the VI server capabilities.
    Regards,
    Jeff Meyer
    Consultant
    Focused Energy
    Suffield, CT USA
    "Alf Katz" wrote in message
    news:[email protected]..
    > Hi guys and gals,
    > On the advice of a lv consultant, we've used an array of global
    > variables to share data (about 100 variables) between an
    acquisition/control
    > program and a consumer program (datalogging) running on the same PC. This
    > worked fine in the development environment. However it no longer works
    when
    > the two programs are compiled. Is there a trick to get this to work or do
    > we have to use datasockets or DDE to move the data.
    >
    > In case you're wondering the idea of two separate programs is to
    > separate the critical control and data acquisition functions from the less
    > critical but more likely to error datalogging functions.
    >
    >
    > --
    > Regards,
    > Alf Katz,
    > [email protected]
    org
    >
    >
    >

  • JavaBeans Data Control / Managed beans interaction

    Working in JDev/ADF 11g
    I have an Application Scoped ADF managed bean that initializes some services for my ADF application. (These are non-database backed business services and so they do not integrate as tightly with Jdev as data controls). They require some constructor arguments and other initialization parameters and so they cannot be written as pure beans.
    I wrote Java Beans to use as data controls that wrap these services. What I would like to do is to keep the creation of these services in the application scoped bean, so they can be used programmatically in other areas. When the data controls beans are initialized, I want to grab their underlying services from the application scoped bean via the ADFContext.
    My issue is that at the time the data control beans are instantiated, the ADFContext returns null when accessing the application scoped bean - ie it has not been created yet.
    What is the proper way to pass initialization data to JavaBean data controls? Ideally I could simply pass the data control a reference to its underlying service.
    If Im going about this all the wrong way, with the application scoped bean holding the application wide business services, please feel free to advise me otherwise.
    Thanks!

    Okay - so I figured out one way to do this (detailed below), but my question still stands as to if there is a proper way to get information to a JavaBean data control when it is instantiated.
    What I just learned is that although my application scoped bean does not exist when the data control is created, it can exist when the the data control is called by the .jspx. I say 'can' because it will only exist if the .jspx backing bean references the application scoped bean as a managed property. i.e. ADF will create the data control, create the page bean, create the application bean (b/c the page needs it), and then call the data control, at which point the data control will find the application scoped bean. This is sort of a hack, since it requires an unintuitive setting for it work. so I think my question still stands, how to pass data from the application scoped bean to the data control.

  • Share data between two different plugins

    Hi All,
    I have two different plugins - In one, I am writing the persistent data and in the other I want to read this data. By making the dependency on the first plugin, I am able to read the data from the second one. But how can we read the data from the second plugin without any dependency on the first plugin?
    Regards
    Sahil

    As I recall, there is a setting to allow SO's to work between
    apps. Also you need to be sure to flush() the so to save the data.
    Another option is LocalConnection.
    Tracy

  • Share Data between Pro and Designer Form

    Good evening,
    Old Form:
    I recently inherited an adobe pro form created a few years ago. The naming conventions are horrible, and they refuse to replace the form to spit out an xml file. But they want the data to fill into an access database.
    New Form:
    I was able to create an adobe designer form, with proper naming conventions, that exports an xml file that can be imported into the access database.
    Help:
    Is there a way to link the old form data to the new form, with the naming conventions being different?
    Ideally, id like to create a button that will display a dialog box to select the old form and import the data without converting to an xml first…is this possible?
    Thanks in advance!

    Hello Pieter,
    Ok, it sounds like you are asking about 5 different things here.  Let me break them up and respond individually.
    There is no overhead inherent to using a MathScript node on RT.  Since the MathScript code is implemented on top of LabVIEW code, there will be varying levels of performance with respect to a native LabVIEW implementation, but simply having the node itself does not cause any overhead.
    On a Windows platform (or other desktop platform), the answer is the same: the node does not introduce any overhead into your algorithm.
    If you use the application builder to create a compiled program that uses the run-time engine, you are no longer able to change the .m file.  Or, to be a little more technically accurate, the LabVIEW run-time engine does not have a compiler.  Thus, you can change the .m file all you want, but the actual .m file that is used by your built application is the version that was present when you built the application.
    The behavior you observe with MathScript executing new code will only happen if you are running a VI with the full development version of LabVIEW.  We need the LabVIEW compiler in order to generate new code when you update a .m file and this is only present with the full development version of LabVIEW.
    The search path is only necessary when you are developing your VI on the host.  You can set a search path by right-clicking on "My Computer" in your project, choosing Properties, and then "MathScript: Search Paths."  Note: your VI will need to be in the "My Computer" target to locate your .m file.  After you have created your MathScript node, you can drag the VI to the target.  You are correct that the .m file is compiled when the program is deployed and you do not need to transfer the .m file to the target.
    Grant M.
    Staff Software Engineer | LabVIEW MathScript | National Instruments

  • Sharing data between a bean and a jsp

    I have a bean that is being used as a helper class for a jsp page. I can call functions in the bean and display what is returned but I can't test the state of the bean in the jsp page. Is this possible?
    my code is below:
    jsp: a form posts info to this page
    <HTML>
    <BODY>
    <jsp:useBean id='portal' class='portal.portal'/>
    <%-- set the username and password --%>
    <jsp:setProperty name="portal" property="*" />
    <jsp:getProperty name="portal" property="dbconnection"/>
    <Center>
    <H1>Welcome to the Portal
    <jsp:getProperty name="portal" property="firstName"/>
    </H1>
    <br>
    <table border="0">
    <%-- while loop grabs all the services --%>
    <%-- case tests for special services (links) --%>
    <%
    String url = "";
    int ServiceID = 0;
    //I CAN'T PULL THE VALUES FOR THESE VARIABLES SO THE WHOLE WHILE LOOP IS SKIPPED!
    while (url.length() != 0)
    switch (ServiceID)
    case 69:
    %>
    <tr valign="top" height="45">
    <td>
    <center>
    " TARGET="new_window"><IMG SRC="images\MEDS TAPE LOG.gif" BORDER=white></A><br>
    </center>
    </td>
    </tr>
    <%
    break;
    case 41:
    %>
    <tr valign="top" height="45">
    <td>
    <center>
    <A HREF="<jsp:getProperty name="portal" property="url"/>" TARGET="new_window"><IMG SRC="images\Lan Support Website.gif" BORDER=white></A><br>
    </center>
    </td>
    </tr>
    <%
    break;
    case 1:
    %>
    <tr valign="top">
    <td>
    <center>
    <form name="loginfrm" action="http://204.104.185.139/pls/WLOG/login.ValidateUser" method="post" target=_parent>
    <INPUT TYPE=hidden NAME=TXTUSERNAME VALUE="<jsp:getProperty name="portal" property="name"/>">
    <INPUT TYPE=hidden NAME="TXTPASSWORD" VALUE="<jsp:getProperty name="portal" property="password"/>">
    <input TYPE="submit" VALUE="<jsp:getProperty name="portal" property="serviceName"/>" style="width: 120px;" >
    <input type="reset" name="reset" value="">
    </Form>
    </center>
    </td>
    </tr>
    <%
    break;
    default:
    %>
    <tr valign="top">
    <td>
    <center>
    <Form method='post' action='<jsp:getProperty name="portal" property="url"/>' name='loginfrm'>
    <INPUT TYPE=hidden NAME="TXTPASSWORD" VALUE="<jsp:getProperty name="portal" property="password"/>">
    <INPUT TYPE=hidden NAME="TXTUSERNAME" VALUE="<jsp:getProperty name="portal" property="name"/>">
    <INPUT TYPE=hidden NAME="firstname" VALUE="<jsp:getProperty name="portal" property="firstName"/>">
    <INPUT TYPE=hidden NAME="lastname" VALUE="<jsp:getProperty name="portal" property="lastName"/>">
    <INPUT TYPE=hidden NAME="id" VALUE="<jsp:getProperty name="portal" property="userID"/>">
    <INPUT TYPE=hidden NAME="role" VALUE="<jsp:getProperty name="portal" property="roleID"/>">
    <input type='submit' name='submit' value='<jsp:getProperty name="portal" property="serviceName"/>'>
    </Form>
    </center>
    </td>
    </tr>
    <%
    break;
    %>
    <jsp:getProperty name="portal" property="nextForm"/>
    <%
    %>
    </table>
    </Center>
    </Body>
    </Html>
    here is the bean:
    //bean for portal
    package portal;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    import javax.servlet.*;
    import java.util.Enumeration;
    import java.sql.*;
    import java.util.*;
    public class portal {
    private ResultSet userInfo;
    private Statement stmt;
    private String pw;//password from the database
    private String FirstName;
    private String LastName;
    private String UserName=""; //network login name
    private String UserPassword="";//password supplied by the form
    private int UserID; // temp variable while pulling the services from the databases
    private int RoleID; // temp variable while pulling the services from the databases
    private String ServiceName=""; //temp variable while pulling the services from the database
    private int ServiceID;
    private String url ="";
    //String Message=""; //testing
    private String Message2=""; //string that sends the correct html back to the jsp
    public int getServiceID(){
    return ServiceID;
    public void setName(String Name){
    UserName = Name;
    public String getName(){
    return UserName;
    public void setPassword(String Password){
    UserPassword = Password;
    public String getPassword(){
    return UserPassword;
    public String getFirstName(){
    return FirstName;
    public String getLastName(){
    return LastName;
    public String getUrl(){
    return url;
    public int getUserID(){
    return UserID;
    public int getRoleID(){
    return RoleID;
    public String getServiceName(){
    return ServiceName;
    public String getDbconnection() {
    try
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
    DriverManager.setLoginTimeout(60);//time out after 1 min.
    Connection con = DriverManager.getConnection("jdbc:odbc:Portal");
    stmt = con.createStatement();
    String query = "SELECT EMP_TABLE.EMP_PASS, MGR_SERVICES.SERVICE_ID,";
    query = query +" MGR_SERVICES.DEFAULT_URL, EMP_TABLE.EMP_USER_ID, *";
    query = query +"FROM (EMP_TABLE LEFT JOIN MGR_USER_SERVICES ON";
    query = query +" EMP_TABLE.EMP_USER_ID = MGR_USER_SERVICES.USER_ID)";
    query = query +" LEFT JOIN MGR_SERVICES ON MGR_USER_SERVICES.SERVICE_ID =";
    query = query +" MGR_SERVICES.SERVICE_ID WHERE (((EMP_TABLE.EMP_LAN_ID)='" + UserName+ "'))";
    //String query = "SELECT EMP_TABLE.EMP_PASS, MGR_SERVICES.SERVICE_ID,";
    //query = query +" MGR_SERVICES.DEFAULT_URL, EMP_TABLE.EMP_USER_ID, *";
    //query = query +"FROM (EMP_TABLE LEFT JOIN MGR_USER_SERVICES ON";
    //query = query +" EMP_TABLE.EMP_USER_ID = MGR_USER_SERVICES.USER_ID)";
    //query = query +" LEFT JOIN MGR_SERVICES ON MGR_USER_SERVICES.SERVICE_ID =";
    //query = query +" MGR_SERVICES.SERVICE_ID WHERE (((EMP_TABLE.EMP_LAN_ID)='landwla'))";
    //String query = "SELECT * FROM EMP_TABLE WHERE EMP_LAN_ID ='landwla'";
    userInfo = stmt.executeQuery(query);
    if(userInfo.next())
    pw = userInfo.getString("EMP_PASS");
    if (UserPassword.equals(pw))
    //Message = "Your logged in";
    //Message = Message + "Luke you sly devil";
    FirstName = userInfo.getString("EMP_FIRST");
    LastName = userInfo.getString("EMP_LAST");
    UserID = userInfo.getInt("EMP_USER_ID");
    RoleID = userInfo.getInt("ROLE_ID");
    url=userInfo.getString("DEFAULT_URL");
    ServiceName = userInfo.getString("SERVICE_NAME");
    ServiceID = userInfo.getInt("Service_ID");
    else
    Message2 = "<Script Language=JavaScript>";
    Message2 = Message2 + "alert('Your Password Information is incorrect');";
    Message2 = Message2 + "window.location.href = 'Login.html'";
    Message2 = Message2 + "</Script>";
    else
    Message2 = "<Script Language=JavaScript>";
    Message2 = Message2 + "alert('Your Login Information is incorrect');";
    Message2 = Message2 + "window.location.href = 'Login.html'";
    Message2 = Message2 + "</Script>";
    catch (InstantiationException i)
    {return (i.toString());}
    catch (ClassNotFoundException c)
    {return (c.toString());}
    catch (SQLException sql)
    {return (sql.toString());}
    catch (Exception e)
    {return (e.toString());}
    return Message2;
    public String getNextForm() {
    try
    url="";
    ServiceName="";
    if(userInfo.next())
    url=userInfo.getString("DEFAULT_URL");
    ServiceName = userInfo.getString("SERVICE_NAME");
    RoleID = userInfo.getInt("ROLE_ID");
    ServiceID = userInfo.getInt("Service_ID");
    catch (SQLException sql)
    {return (sql.toString());}
    return Message2;

    Of course you can.
    <%
    String url = protal.getUrl();
    %>

Maybe you are looking for