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. 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. Christos Gravvanis
    Replies:
    0
    Views:
    2,030
    Christos Gravvanis
    Jul 7, 2004
  2. John Smith
    Replies:
    2
    Views:
    2,184
    Sampsa Sohlman
    Jul 15, 2004
  3. Rakesh Pandit
    Replies:
    0
    Views:
    493
    Rakesh Pandit
    Jul 12, 2005
  4. Marcin Cenkier
    Replies:
    1
    Views:
    5,385
    Marcin Cenkier
    Apr 12, 2006
  5. Andi
    Replies:
    5
    Views:
    1,317
Loading...

Share This Page