wood burning stoves 2.0
The moose likes JSP and the fly likes session attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "session attribute" Watch "session attribute" New topic

session attribute

Sophia Choi
Ranch Hand

Joined: Mar 22, 2002
Posts: 106
Problem:When I pass the attributes from pgm1.jsp to pgm2.jsp, it is ok the first time. But when I try again and it's supposed to get new parameters and saved in session attributes again in pgm1, but the result is the same in pgm2.
I use System.out.print to print cou_code in pgm1 and it displays correctly, but the result doesn't match in pgm2.The result is always the same.
Pgm1.jsp: a).It contains serveral session.setAttribute("cou_code");.....
b).a form inside which calls onSubmit to trigger javascript:window.open('pgm2.jsp','ExPrt','target=_blank',top=110,left=100,toolbar=no,scrollbars=no,location=no,width=300,height=5,status=no';return false;
c.) a submit button
Pgm2.jsp: a) session=true in @page
b) session.getAttribute("cou_code")......pgm processing
c) display a table

How can I solve it? Thanks a lot
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
I think it's the method of opening the window. Does the problem happen only in windows MSIE?
I have heard that JS popups screw up sessions.

First off, does this actually work:

Why don't you try

To see if it's the same session in the popup, put this in the main win:

And put this in the popup win:

Compare the alert box with the session_id param in the popup.

comp.lang.javascript FAQ: http://jibbering.com/faq/
Sophia Choi
Ranch Hand

Joined: Mar 22, 2002
Posts: 106
Hi Garrett,
Thanks for your reply. My harddisk has crashed, so I can't tell you what is the result. I can tell you that Netscape can do without problem .
Do u have any idea to fix it in IE ?
I agree. Here's the link: http://aspose.com/file-tools
subject: session attribute
It's not a secret anymore!