• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Session Tracking problem.. Please help

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It does not work with both IE6 and firefox
 
reply
    Bookmark Topic Watch Topic
  • New Topic