session attribute

Discussion in 'Java' started by Steve Jones, Nov 16, 2003.

  1. Steve Jones

    Steve Jones Guest

    On Sun, 16 Nov 2003 09:14:44 -0800, Zee wrote:

    > I am having problem with session attribute for example
    >
    > ArrayList customer = CustomerBean.getCustomer(conn);
    > session.setAttribute("customer", customer);
    >
    > My question is why we are using two parameter there and what is the purpose?
    >


    The first parameter is the reference used to access the object in the
    future, and the second parameter is the object itself.


    > My next question is how can I call this session attribut to get the preserve
    > data?


    session.getAttribute("customer");

    Note that getAttribute returns an Object, so you'll have to cast it back
    to an ArrayList.


    Of course, this is all in the API documentation :)

    Steve.



    >
    > Thanks in advance.
    >
    > Zee
    Steve Jones, Nov 16, 2003
    #1
    1. Advertising

  2. Steve Jones

    Zee Guest

    I am having problem with session attribute for example

    ArrayList customer = CustomerBean.getCustomer(conn);
    session.setAttribute("customer", customer);

    My question is why we are using two parameter there and what is the purpose?

    My next question is how can I call this session attribut to get the preserve
    data?

    Thanks in advance.

    Zee
    Zee, Nov 16, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Smythe
    Replies:
    3
    Views:
    1,242
    Jeff Smythe
    Jan 2, 2004
  2. Bostonasian
    Replies:
    1
    Views:
    817
    Joris Gillis
    Sep 18, 2005
  3. Replies:
    2
    Views:
    1,076
    Henry S. Thompson
    Mar 6, 2006
  4. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,277
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  5. Jazzis
    Replies:
    2
    Views:
    245
    Jazzis
    Sep 23, 2003
Loading...

Share This Page