tomcat session problem

Discussion in 'Java' started by shoeb26@hotmail.com, May 15, 2007.

  1. Guest

    set.jsp
    -----------------------------------------
    <%@page language="java"
    import="javax.naming.*"
    import="java.math.*"
    import="javax.sql.DataSource"
    import="java.sql.Connection"
    import="java.sql.ResultSet"
    import="java.sql.PreparedStatement"
    import="java.sql.Date"
    import="java.util.*"
    import="java.text.*"
    import="java.util.ArrayList"
    %>

    <%
    session.setAttribute("t", "test");
    String referPage = "get.jsp";

    out.println(session.getAttribute("t"));
    %>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    //window.location.href = '<%=referPage%>';
    //-->
    </SCRIPT>
    <a href="<%=referPage%>">link</a>

    </BODY>
    </HTML>
    ---------------------
    get.jsp
    ---------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> :: Midland Wealth Intranet :: </TITLE>
    </HEAD>

    <%out.println(session.getAttribute("t"));%>

    </HTML>
    ----------------------------------
    however "null" is displayed, can anyone help me , urgent
     
    , May 15, 2007
    #1
    1. Advertisements

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,523
    Jeff Smythe
    Jan 2, 2004
  2. Christos Gravvanis
    Replies:
    0
    Views:
    2,246
    Christos Gravvanis
    Jul 7, 2004
  3. John Smith
    Replies:
    2
    Views:
    2,397
    Sampsa Sohlman
    Jul 15, 2004
  4. Rakesh Pandit
    Replies:
    0
    Views:
    656
    Rakesh Pandit
    Jul 12, 2005
  5. Marcin Cenkier
    Replies:
    1
    Views:
    5,841
    Marcin Cenkier
    Apr 12, 2006
  6. =?Utf-8?B?Um9iSEs=?=
    Replies:
    4
    Views:
    5,817
    =?Utf-8?B?Um9iSEs=?=
    Apr 11, 2007
  7. Andi
    Replies:
    5
    Views:
    1,523
  8. Jazzis
    Replies:
    2
    Views:
    398
    Jazzis
    Sep 23, 2003
Loading...