Results 1 to 2 of 2
  1. #1
    osval is offline Member
    Join Date
    Jul 2007
    Posts
    26
    Rep Power
    0

    Default problems with assigning a value to object session

    I'm trying to assign a value to the object session :

    Java Code:
    <@ page session="true">
    String var_name = "name";
    String var_value = "value";
    session.putValue(var_name,var_value);
    Then I'm submitting to the same page and trying to read from the session :
    Java Code:
    String get_val = (String)session.getValue("name");

    It always gives me "null".
    I'm trying to get session object like that:
    Java Code:
    "HttpSession session = request.getSession(true)"
    But every time I'm calling session.isNew() it returns me "true".
    Do you know what's the problem?
    thanks

  2. #2
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

    Default

    get/setValue of the HttpSession interface have been deprecated. Try using setAttribute(String, Object) and getAttribute(String)

Similar Threads

  1. session object
    By 5alive in forum New To Java
    Replies: 1
    Last Post: 06-23-2008, 12:45 AM
  2. Problems passing a scan object to a method
    By xkross in forum New To Java
    Replies: 4
    Last Post: 04-16-2008, 03:56 PM
  3. problems with applet session between to two applets
    By elizabeth in forum Java Applets
    Replies: 1
    Last Post: 08-07-2007, 03:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •