jsp - different session.getAttributes

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • asaguden

    jsp - different session.getAttributes

    Hi!
    I wonder if there is a difference [if so, what] between:

    User user = (User)session.g etAttribute("us er");

    and:
    User user = (User)request.g etSession(false ).getValue("use r");

    /peter
  • Ryan Stewart

    #2
    Re: jsp - different session.getAttr ibutes

    "asaguden" <asaguden@lycos .com> wrote in message
    news:b190197d.0 401070238.d1e2a [email protected] le.com...[color=blue]
    > Hi!
    > I wonder if there is a difference [if so, what] between:
    >
    > User user = (User)session.g etAttribute("us er");
    >
    > and:
    > User user = (User)request.g etSession(false ).getValue("use r");
    >
    > /peter[/color]

    request.getSess ion(false) and session refer to the same object, as does
    request.getSess ion(true). The difference is that the latter will create a
    session object if one does not exist. The difference between getAttribute
    and getValue is that getValue is deprecated. Use getAttribute.


    Comment

    Working...