Implementing Session in flex (Store an object in Session)

Hi All,
   Is it possible to store an array collection in session ? How can this be implemented ?
Thanks

Have the password visible??? Why??? All you have to do is to capture the password that the user typed in and pass it as a variable to the connection string.
Say, if you are using the JDBC:ODBC bridge, it will be something like this:
Connection con = DriverManager.getConnection(
url, login, password);
//where url, login, and password are all variables.
Hope this helps.

Similar Messages

  • How to store complex data in session object

    Hi All,
            I have a requirement like this, I have to store some complex data(like some object) in webdynpro session object.
    I know that i can store some string value in session by using wdScopeUtil and is it possible to store some complex data like(object ot object array).
    See i have some ContryTO[] object which contains countrycode and value i have to store this Array object in session.How can I solve this problem,i am strucked regarding this pls help me regarding this issue.
    Regards,
    saleem

    Bala,
    Go thru this link. It may be useful to you.
    Maintaining caching for a user session in webdynpro
    List elementList = new ArrayList();
    // set values to your list.
    IMaintainScope maintainer = Utils.getScopeMaintainer(WDScopeType.APPLICATION_SCOPE);
    maintainer.getScope().put("list",elementList);
    List elementList1 = (List)maintainer.getScope().get("list");
    Regards,
    Sridhar

  • Flex store example + deep linking search engine question or LocalShared objects

    hi, i wanna make a onlineshop site.
    i'm wondering what would be the best approach.
    if you use the adobe demo ...
    http://www.adobe.com/devnet/flex/samples/flex_store/
    + some other MXML and ActionScript tricks and build a 1 app web.
    on a old style website you would have the basic 5 pages + a page for every product.
    witch can be easily indexed by a search engine.
    as everyone knows, the more pages you have, the greater the chance is that some search engine will show your article/product, depending the keywords of the person is using (+ some other factors).
    i know that google can index in SWF files.
    but i don't think they will actually execute the application you made and scan all products you offer via the 'Flex Store' demo.
    the cool part about 'Flex Store' demo, you user doesn't need to wait for page loads.
    i have understood, that local shared object's can only the used by the same application.
    i would like to have some input from you guys.
    because i think the Flex Store demo rock, especialy the product compare and price search options.
    kind regards

    Congrats to Carmelo!
     Windows Phone and Windows Store Apps Technical Guru - February 2015  
    Carmelo La Monica
    Windows Phone 8: control Nokia Maps (Part 3)
    JH: "Part 3 of the series how to work with the Nokia maps control. As the previous articles this one contains a lot of code snippets and some pictures. Good work!"
    Ed Price: "A great topic, a fantastic breakdown of sections with clear descriptions, and a nice mix of code formatting and helpful images! Another stellar article from Carmelo! Great job including the link back at the end to the portal
    article!"
    Ed Price, Azure & Power BI Customer Program Manager (Blog,
    Small Basic,
    Wiki Ninjas,
    Wiki)
    Answer an interesting question?
    Create a wiki article about it!

  • Am i able to set a class object to session?

    Hi,
    i want to store some session data in a web application. I understand session can be set by this way:
    session.setAttribute('student', name);
    session.setAttribute('teacher', name2);
    However the method above stores one a value in a session. I want to store many data in a session. I have code in this way for learning purposes. This is what i'm doing picking from bits and pieces from the internet. Please advise if whether i'm on the correct track.
    I have a student class
    public class Student {
        String name;
    public String getName() {
              return name;     
    public String setName(String name) {
              this.name = name     
    I have a teacher class
    public class Teacher{
          String name;
          public String getName() {
              return name;     
          public String setName(String name) {
              this.name = name     
    I create a SchoolSessionBean class to store this object into a session
    public class SchoolSessionBean {
           private Student student;
              private Teacher teacher;
           public SchoolSessionBean {
           public Student getStudent() {
             return student;
           public void setStudent(Student student) {
             student = student;
            public Teacher getTeacher() {
             return teacher;
           public void setTeacher(Teacher student) {
             teacher = teacher;
    }Ok. Now i want this SchoolSessionBean class to store in a session. This SchoolSessionBean class also stores the data for the student and teacher.
    Inside this class, this is what i coded to store the SchoolSessionBean into a session
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession;
    public class createSession{
         Student student = new Student();
         Teacher teacher = new Teacher();
         student.setName("John");
         teacher.setName("Dave");
         HttpSession session = request.getSession();
         SchoolSessionBean schoolSessionBean = (SchoolSessionBean)session.getAttribute("schoolSessionBean");
         schoolSessionBean.setTeacher(student);
         schoolSessionBean.setUsagerDetails(teacher);
    }I have not create the jsp but if on the jsp, can i get the session of the schoolSessionBean anywhere, on any page of the jsp and get the values from the student and teacher class using the codes below?
    Can i use the codes below to retrieve the values of the names on any page of the jsp?
    These codes are implemented on JSPS.
    SchoolSessionBean schoolSessionBean = (SchoolSessionBean)session.getAttribute("schoolSessionBean");
    String name1 = schoolSessionBean.getStudent().getName();
    String name1 = schoolSessionBean.getTeacher().getName();Edited by: leeChaolan on Mar 24, 2009 9:11 AM

    Oh i see. So if i want to set the class to a session, can i do it this way as shown below? I plan to try it tonight to see if it works. But just at the mean time, i like to seek some advice on my codes.
    SchoolSessionBean schoolSessionBean = (SchoolSessionBean)session.getAttribute("schoolSessionBean");
         schoolSessionBean.setTeacher(student);
         schoolSessionBean.setUsagerDetails(teacher);Thanks

  • Session in Flex

    You can Use the following class as a session in flex..
    [Bindable]
    private var session:Session = Session.getInstance();
    How to insert data to session
    session.setAttribute('username','sanka')
    How to retrive data from session
    var userName:String=session.getAttribute('username');
    http://dl.dropbox.com/u/7375335/Session.as
    package model
        import flash.utils.Dictionary;
        [Bindable]
         * @author Sanka Senavirathna
         *<p>
         *    Conforms to Singleton Design Pattern.
         *     </p>
         *    <p>
         *        Session.getInstance().getAttribute(key)
         *        Session.getInstance().setAttribute(key,value)
         * Code example for client
         [Bindable]
         private var session:Session = Session.getInstance();
         session.getAttribute('name')
         *    </p>
        public class Session
            private static var instance:Session = new Session();
            private var dic:Dictionary=new Dictionary(); // keep user session
            public function Session()
                if (instance != null) { throw new Error('Cannot create a new instance.  Must use Session.getInstance().') }
             * This Session is a Dictionary that keep key value pairs.Key can be object and value can be object.
             * [Bindable]
             * private var session:Session = Session.getInstance();
             * @langversion ActionScript 3.0
             * @playerversion Flash 8
             * @see getAttribute
             * @see setAttribute
             * @author Sanka Senavirathna
            public static function getInstance():Session
                return instance;
             * [Bindable]
             * private var session:Session = Session.getInstance();
             * Session.getInstance().setAttribute(key,value)
             * <p>example
             * session.setAttribute('username','sanka')
             *</p>
             * @langversion ActionScript 3.0
             * @playerversion Flash 8
             * @param key Describe key here.
             * @param value Describe value here.
             * @see getAttribute
             * @author Sanka Senavirathna
            public function setAttribute(key:*,value:*):void
                dic[key]=value;
             * [Bindable]
             * private var session:Session = Session.getInstance();
             * Session.getInstance().getAttribute(key)
             * <p>example
             * var userName:String=Session.getInstance().getAttribute('username');
             *</p>
             * @langversion ActionScript 3.0
             * @playerversion Flash 8
             * @param param1 Describe key here.
             * @see setAttribute
             * @author Sanka Senavirathna
            public function getAttribute(key:*):*
                return dic[key];

    I think This will help you to keep your shaired data in single place.this will optimize your program by
    reducing database hits,
    reducing Server hits
    Onece you retrive the data then put it into session (flex) and retrive it when you need..For example username in system.when user logged successfully
    put the user object in to session and hide the login component.then pop-up your other component.But you can access the user data from session by using
    var user:User=Session.getInstance().getAttribute('user'); something like that.
    Hope this will help you.
    enjoy
    happy cording

  • How to obtain a session object from session id

    Hi all,
    let say that I have a list of session ids, and I want by scheduald task to check whether the session is alive\active.
    I saw that the HttpSessionContext was deprecated. (see: http://javasolution.blogspot.com/2007/08/getting-session-object-using-session-id.html)
    Is there any other way to check if the session is alive?

    Do it the other way: let the session itself notify that it is not alive anymore.
    Implement a HttpSessionListener which adds the session to list/set/map on create and removes the session from it on destroy, register it in the web.xml and run it.

  • Sessions in Flex

    Can anyone tell me how sessions work in Flex? From a browser perspective, I understand when a new session is created the ID is saved into a session cookie client-side and this ID is used to link the browser to the server-side session. But I can't find any cookies that relate to my Flex application (assuming it uses cookies).

    Session informatione is, basically, every variable you create and store in the Flex application.
    Sessions cookies are a work around for the stateless nature of HTML Pages.  Every HTML page exists in isolation andk nows nothing about any other HTML page or the history of the user viewing that page.  The server sets a cookie to match the request up a request with a server side session.
    In Flex, there is only one page request, so no need for cookies to keep track of sessions.  The complete app exists 'once' for each user; as opposed to the server side code which is shared across all users.
    That said, if you need sessions for your server side code; remote requests from Flex will include the cookie information set by the server; which will allow said requests to match your remote call to a server side session.
    Flex does not have access to read browser cookies, although it may be possible to do so using ExternalInterface and JavaScript.

  • Ho to store java objects in oracle database

    HI
    for me the sceanario is,
    i neeed to create , dynamically a table at the time of specified action.
    i need to store the values retreieved from session and store it in a database..
    for example
    User usr=session.getAttribute("usr"); i need to store the user object.
    and hashtable and hashmap values without iterating.
    please suggest at the earliest
    can it be done?
    Regards,
    Ramesh

    my requirement is like that,bcos of two different weblogic servers need to acess the central database.which contains user information.
    The user object from first server will be stored in database.and the second server will retrieve the user information and it will set for its application.
    please suggest me how to store java objects in database.
    regards,
    Ramesh

  • How to use Java NIO to implement disk cache for serialized java objects

    Hi,
    I have a cache (implemented as hahstable etc.) that contains java objects (mostly strings) and swaps objects from runtime memory to the disk and back based on some algorithms. Currently, the reading and writing from the disk is implemented using java.io.* package i.e. fileInputstream and FileOutputStream. Essentially, I serialize the java object and write to the disk and the deserialize and give it back to the Hashtable cache.
    The performance of swapping from disk to memory is kinda slow. I have read that memory mapping would improve the performance.
    My idea is to do the following:
    Have one big file mapped to memory. I write the serialized objects to different portions of the file and then read those portions when needed. I can use the MappedByteBuffer for that but then I have the following questions. I will not store objects in the hashtable anymore.
    1. How do I delete things from the cache in the above design i.e. how do I delete portions of a mapped file?
    2. How do I serialize objects using ByteBuffers and then deserialize them? I guess this shouldn't be hard but just want to confirm.
    Do you think this is the right design or should I change? Right now using the old io package, I have a separate file for each object. When using the NIO package, I want to store all objects in a single file in different portions of the file, is that the right way to go?
    As you can see, I am beginner in memory mapped io and need help.

    Have one big file mapped to memory. I write the serialized objects to different portions of the file and then read those portions when needed. I can use the MappedByteBufferThis is a good idea, one that I have worked on. It involves quite a bit of manipulation with temporary buffers and a deep working knowledge of object serialization.
    1. How do I delete things from the cache in the above design i.e. how do I delete portions of a mapped file?The best way to handle this is do a two-step process, cutting the file into two pieces and gluing it back together where the original one is...
    2. How do I serialize objects using ByteBuffers and then deserialize them? I guess this shouldn't be hard but just want to confirm.It is hard. Wrapping the streams and making the IO work properly is not the challenge however. The hard part comes in hacking the object streams. The object input/output streams use a ClassDescriptor object which only gets written once/ read once. This shouldn't be a problem if you will read/write the entire file at once, but will bring you grief if you want random access to your objects. You will also need an indexing mechanism to support random access.
    Do you think this is the right design or should I change? Right now using the old io package, I have a separate file for each object. When using the NIO package, I want to store all objects in a single file in different portions of the file, is that the right way to go?I guess it depends on your needs. Do you require random access to objects? NIO provides some performance gains, but mostly for very large amounts of data (>10M in my experience).
    You can always write all your objects into the same file using normal io techniques and you can still generate an index and acheive random access. It might be easier...
    Good luck

  • Minimise and maximise buttons in Flex Store

    Hi,
    I'm writing a Flex app and would like to implement something
    similar to the Flex Store's minimise and maximise buttons. I know
    how to add an icon using titleIcon in the Panel properties but I
    would like to add two buttons to the panel header. Can anyone give
    me any ideas on how to add these buttons to the header of the
    panel?
    Thanks in advance,
    Pete

    Hi
    I'm trying to do something similar and I'm looking at the
    code from Flexstore to work out what is going on.
    The problem I'm having is I keep getting:
    "Access of undefined property titleBar"
    "Access of undefined property statusTextField"
    "Access of undefined property titelTextField"
    Is there something obvious that I'm missing? I'm really new
    to Flex and it could be something obvious.
    I wondered if it was something to do with the changes made
    for the final release, but when I downloaded the Flexstore source I
    got it to work locally.
    Here is the code I'm using that is sat inside a panel
    component:
    <mx:Script>
    <![CDATA[
    import mx.core.IUIComponent;
    import mx.effects.Move;
    import mx.containers.Panel;
    [Bindable]
    private var titleButtons:CatalogTitleButtons;
    override protected function createChildren():void
    super.createChildren();
    titleButtons = new CatalogTitleButtons();
    titleBar.addChild(titleButtons);
    override protected function
    layoutChrome(unscaledWidth:Number, unscaledHeight:Number):void
    super.layoutChrome(unscaledWidth, unscaledHeight);
    titleButtons.width = unscaledWidth / 2;
    titleButtons.height = titleButtons.measuredHeight;
    titleButtons.move(statusTextField.x - titleButtons.width,
    titleTextField.y);
    ]]>
    </mx:Script>
    Any advice would be great.
    Thanks
    Elsa

  • Can we store result set in session..??

    can we store result set object in session..??if yes ,,say i close the connection and use that result set object in some another page,,what happen if u call updateRow(),deleteRow() or insertRow()

    You can store a result set object in session.
    However you also have to keep that result sets connection open and dedicated to that result set.
    In that scenario you will have a 1 db connection per session. Not very nice. And NOT recommended.
    Once you close a ResultSet's connection then you shouldn't access the ResultSet. Simple as that.

  • Error message: AgServerMigration ERROR Using store provider as a session is deprecated.

    Hi.  I'm using a MacBook Pro, OS X 10.6.5.  I have been opening files in Lightroom, editing them, and then doing finishing touches in CS5.  When I save the file in CS5 and close it, my Mac returns the above message in Console eight times:
    AgServerMigration ERROR Using store provider as a session is deprecated.
    AgServerMigration ERROR Using store provider as a session is deprecated.
    AgServerMigration ERROR Using store provider as a session is deprecated.
    AgServerMigration ERROR Using store provider as a session is deprecated.
    AgServerMigration ERROR Using store provider as a session is deprecated.
    AgServerMigration ERROR Using store provider as a session is deprecated.
    AgServerMigration ERROR Using store provider as a session is deprecated.
    AgServerMigration ERROR Using store provider as a session is deprecated.
    I have no idea what this means, or whether it is a problem.  Does anyone know what this is?
    Thanks.

    I see the same thing and have done for some time. The actual file is being saved back. etc. So, in that respect both Lr and Ps are working fine. IOW, ignore it.

  • Regarding session in flex

    hi,
    My question is ,how i have set session in php and in flex. i could not know how to set session in flex and php.How to handle session in flex.
    Please provide me solution to solve the problem.
    Thanks and Regards,
    venkat.R

    Hi Venkat,
    You have to save PHPSESSID. for each request you made to server send this as URLVariable.
    I think this should work.
    let me know If it is helpfull.....
    Thanks,
    Vikram

  • How to remove an object from session with JSF 2.0 + Faceletes

    hi all,
    I have a facelets page which calls a backing bean of session scope. Now when ever i click on this page i want the existing bean object to be removed from the session . In my existing jsp i have a logic something like this to remove the object from session
         <% if (request.getParameter("newid") != null) {
              request.getSession().removeAttribute("manageuserscontroller");
    %>
    Now i have to refactor my jsp to use facelets and i should not be using scriplets anymore . I did try with JSTL but the <c:remove> tag is not supported by facelets.
    Can someone help me how can i refactor this code to work for my facelets?
    I really appreciate your help in advance
    Thank you

    r035198x wrote:
    Redesign things so that the remove is done in a backing bean method rather than in a view page.Exactly that. I tend to cleanup session variables at the start and at the end of a page flow; generally the end is some sort of save or cancel action being invoked through a button but that is application specific.

  • About putting conenction object in session

    Hi,
    iam having an application with jsps.i need to connect databse multiple times.so far iam doing in this way..the first time when i connect to database then iam putting that connetion object in session and using whereve i require..but i have i doubt wther this is good practice are not.
    please advise me on this.are i have to connect to database in each page and close the connection once the operation is finished..which one is best way..

    worst is to keep connection in a session, this willr esult in alot of open connection not being used.
    Better is to create and close a connection each time youneed one
    Best is to use a Connection pool.

Maybe you are looking for

  • Can I buy an iPhone 5 in the Sydney Apple Store?

    Are there any Australians out there that can answer this for me? I'm going on holiday to Sydney (I live in New Zealand) in a week, and it would be great if I could buy an iPhone 5 there, instead of waiting a few more weeks for them to ship if I bough

  • HP Officejet Pro 8610 (Network)' is offline every morning

    I am running Windows 8. I use IE 11 and Chrome on occasion. Every morning I have trouble "waking up" my printer. I get "HP Officejet Pro 8610 (Network)' is offline". Sometimes turning the printer on and off resets it but today nothing seems to work.

  • NB100 3G Ericsson F3507g not working with Windows 7

    I've done everything and I can't make it work in Windows 7, although it works on Windows XP. I've already upgraded the modem firmware to the latest R1D06 (I had to downgrade to XP to do it, because in windows 7 the upgrade program notices "No module

  • Crap Throughput on MESH

    Ok, so I have two WLC5508 controllers running 7.0.230.0, which having the two of them probably is inconsequential because all the APs are added to only one controller. The problem I'm facing is that I have several LAP1552E's deployed throughout my fa

  • Load BLOB

    Hi oracle 10.2.0.1.0 I tried the following code CREATE OR REPLACE PROCEDURE load_lob AS   id         NUMBER;   image1     BLOB;   locator    BFILE;   bfile_len  NUMBER;   bf_desc    VARCHAR2(30);   bf_name    VARCHAR2(30);   bf_dir     VARCHAR2(30);