Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Session Tracking problem.. Please help

 
ramakrishna kulkarni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sample Jsp
==============
<h1>Hi</h1>
<body>
<%
String user=(String)session.getAttribute("Name");
out.println(user);
%>
<form action="test.do" method="post">
Name :<input type="text" name="name" >
<input type="submit" value="Go">
</form>
</body>

==========
The above jsp calls this servlet code

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
String user= request.getParameter("name");
session.setAttribute("Name",user);


}

===================

Put a value in Name field in jsp and submit the form.
Now invoke the jsp for the second time by opening a new tab the jsp displys the Name entered in for the first time in jsp.
The same does not work if we open a new window and try to invoke the same jsp.

Please clarify what is wrong with this code
 
Ankit Garg
Sheriff
Posts: 9529
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The same does not work if we open a new window and try to invoke the same jsp.

Which browser are you using?? As far as I remember, IE8 has this capability and it might be achieved by adding an ad-on to the browser...
 
ramakrishna kulkarni
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not work with both IE6 and firefox
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic