*
The moose likes Struts and the fly likes Session expires showModalDialog fnc call followed by window.open fnc call Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Session expires showModalDialog fnc call followed by window.open fnc call" Watch "Session expires showModalDialog fnc call followed by window.open fnc call" New topic
Author

Session expires showModalDialog fnc call followed by window.open fnc call

Aman Jain
Greenhorn

Joined: Feb 02, 2011
Posts: 15
Hi,

I have my main jsp in my application. There is a link on the jsp called - "Quick Links". Clicking on this link opens up a modal window. Following is the call that opens up the modal window -

var winRef = showModalDialog("QuickLink.jsp", this.parent, "dialogHeight:400px;dialogWidth:700px;center:yes;helpff;resizable:yes;scroll:yes;status:no");

After this a new window (modal window) comes up. On the modal window I have another button clicking on which yet another window pops-up. Following is the call executed when clicking on the button on the modal window that came up from the previous call -

popupWindow=window.open(url, 'Popup', 'height=400,width=650,left=200,top=300,center=yes,help=off,resizable=yes,scroll=no,status=no');

the value of the url = 'PicklistManager.do?' + 'picklistName=' + as_picklist_name + '&fieldId=' + as_field_id + '&isNew=' + isNew;

Issue comes up after the above window.open call. Session expires and the user directed to the login page in the window that came up with the window.open call above.

The application is in Struts and all the three pages as mentioned above are JSPs.

Any pointers please. Spent quite a lot of time but no solution yet. Another blocking part in fixing the issue is that the issue is coming up only in the UAT env and not on the local environment.

ITs very urgent. Any help would be highly appreciated.

Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

What is the session timeout setting?
Your approach should be why the session is getting timeout... is that not the problem...

Is there a proxy in UAT? what is the diff between the loacl and UAT ENV.

What i can think of with so many blanks is your UAT ENV has a proxy server which disables cookies or chache and you are trying to refresh the page in the popup.... is it true?

Would need more information anyways..


Have Fun with Java
little,little.. little by little makes a lot..
Aman Jain
Greenhorn

Joined: Feb 02, 2011
Posts: 15
Just verified and found that there is no proxy running in the UAT environment for my application and that we are not trying to refresh the page. We are simply making a call to window.open where in we have to render the jsp simply.

Any idea.... if there is a possibility of loosing session because of the showModalDialog and window.open calls? As far as I knoow the session is retained in these calls. Please suggest
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Are you using BASE tag in any related popups?
Aman Jain
Greenhorn

Joined: Feb 02, 2011
Posts: 15
I hope you meant this tag <base target=""> tag. If yes, then am not using this tag in any of the JSPs related to the popup. But googling around I found in one of the forums suggesting to use this tag as follows -

<base target="_self" /> --> Adding this tag in the head section of the dialog page. I tried but I couldnt verify if there were any changes coming out of adding this tag.
Aman Jain
Greenhorn

Joined: Feb 02, 2011
Posts: 15
Link of the blogs where I found the use of base tag as mentioned in my previous post -

http://leonwoo-tech.blogspot.com/2008/07/tips-session-is-lost-when-using.html
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

No it might be a problem only if you use it since there might be some problem with the target.. however it is not the problem

Verify: What is the diff between the two ENVs

Verify: What are the browsers used in both places and the versions of browsers.

Anyways, on click of the button from modal window it is hitting the action class, right? put a log or sysout there in UAT and see if the request is reaching that behavior in action class... if yes that implies that the problem is after response of this behavior..
If yes, then the problem is in popup
Aman Jain
Greenhorn

Joined: Feb 02, 2011
Posts: 15
I am trying to figure out the differences with the concerned team but was trying rule out the possibilities of any issue with code in the jsp and javascripts files..

Another observation that I noticed is that this issue consistently can be recreated in IE6.0 but the issue occurs intermittently in IE7 & IE 8 versions. But in the UAT environment all the users use only IE and no other browsers.
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

Well the problem could also be in the code, not just ENVs, this is where standards are important (so called interoperability )
As mentioned already, also verify the last point of execution of your request to know where it failing
Aman Jain
Greenhorn

Joined: Feb 02, 2011
Posts: 15
Another observation that I noticed is that this issue consistently can be recreated in IE6.0 but the issue occurs intermittently in IE7 & IE 8 versions. But in the UAT environment all the users use only IE(either 6.0, 7.0 or 8.0) and no other browsers.
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

and your local still works fine IE 6 consistently... intresting, can you just tell if the host name in your UAT is an IP (similar to what you use in your local) address or some other name? I still have a strong feeling that there is something sitting in between application server and the browser, web server?
Shankar Tanikella
Ranch Hand

Joined: Jan 30, 2011
Posts: 329

If using ajax anywhere also try this. I am not sure what it does though, just from google. Sorry if i am wasting your time.

Some general reasons

Anyways, disable cookies for IE6.0 in your local and try the same scenario

other related link here
 
 
subject: Session expires showModalDialog fnc call followed by window.open fnc call
 
Similar Threads
Pop up window to the user when session is about to timeout.
Double LDAP Authentication Requests Using Weblogic 7
history.back() not retaining changed values in previous page after window.open() call
window.open() and session variable
How to avoid WebLogic Re-authentication with modal windows