I have a
jsp called register.jsp. After verifying the user name and password in register.jsp it gets forwarded to thankyou.jsp if the verification is successful, if it failed it gets forwarded to register.jsp.
Here I am posting the reset method from the class that extends ActionForm.
---------------------------------------------
public void reset(ActionMapping mapping, HttpServletRequest request) {
HttpSession usersession = request.getSession(false);
String name=(String)usersession.getAttribute("username");
if (request.getParameter("userid")!=null | name == null){
System.out.println("THE USERID ATTRIBUTE COMING FROM REQUEST TO RESET IS " +request.getParameter("userid"));
usersession.setAttribute("username", request.getParameter("userid"));
//name=(String)usersession.getAttribute("username");
System.out.println("setting username attribute to "+(String)usersession.getAttribute("username"));
}
name=(String)usersession.getAttribute("username");
System.out.println(">>>>username attribute is " +name);
userid = name;
password = "";
}
---------------------------------------------
I have some problem with reset method or with session tracking. It happens when I
test the application in the following order.
1.Open a browser window say window1 (IE)
2.Open a browser window say window2 (IE)
3.Enter username1 in window1 and click submit button
4.Enter username2 in window2 and click submit button
Now in window1, username field is pre filled with username1 and in window2 username field is pre filled with username2.
5.Now come to back to widow1 and place the cursor at the end of address line and hit enter in the key board. Now in window1, the username field is pre filled with username2. What I wanted was, pre fill each session with each user�s username. Can somebody suggest some thing? Any help appreciated.
[ June 01, 2006: Message edited by: PradeepPillai Pradeep ]