RE: session time-out in pop-up windows
Why not call request.isRequestedSessionIdValid() to find out if the session timed out? Or, try something inside struts such as request.getSession().isNew() to see if the session didn't exist before the call, then see if the session Id came from a cookie or embedded in the URL: 1) request.isRequestedSessionIdFromCookie() 2) request.isRequestedSessionIdFromUrl() Method name might be URL, not "Url" depending on your JDK level. Why use a complicated filter? Just add that to your action's Or throw it into your module's RequestProcessor, OR use it to throw an Exception (Struts 1.1), that is defined as the appropriate login page for your webapp? Regards, David -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 03, 2003 7:19 AM To: [EMAIL PROTECTED] Subject: session time-out in pop-up windows I am using Filters to determine whether session has timed out or no and redirect user to login page. The implementation class extends Action class so you could display appropriate messages on login page when user gets redirected to it due to time out. However this does not work well when there are pop-up windows: e.g. When user clicks on a hyperlink in a parent browser window, a new pop-up window opens to display information. But when the session has timed out, the pop-up window displays "session time out error" and redirects it log in page. What I intend to achieve is that when the user clicks on the hyperlink and if the session has expired new pop-up window does not open and is the redirected to login page in the parent browser window itself. One possibility is to associate the hyperlink on the page with a form submission and then verify session time out in Action class but then how to open pop-up window from within Action class? Any other possibilities? Any suggestions/pointers will be much appreciated. Regards Chinmay This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session time-out in pop-up windows
hi, pls turn of the accept reciept. its damn annoying. rajatp [EMAIL PROTECTED] wrote: Hubert Thanks for this. But how would filter recognise that the request was sent by a popup? As I understand, the process is like: - pop-up window opens - Page would read global forward url from the struts config file (the page to display) - It will check filter: if "filter pass" is true display url page else display error page. So I am not sure, how Step 3 and then 4 could be implemented. -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: 03 November 2003 14:50 To: Struts Users Mailing List Subject: Re: session time-out in pop-up windows Another way might be: 1. user clicks link for pop-up window, window pops-up and initiates the web request 2. Filter intercepts the request and senses that the session has timed out 3. Before redirecting, filter recognizes that the request was sent by a popup, and instead redirects to a different pop-up page 4. The session-expired pop-up window shows in the browser with JS code to (a) redirect the parent page to the login window and (b) close itself. --- [EMAIL PROTECTED] wrote: I am using Filters to determine whether session has timed out or no and redirect user to login page. The implementation class extends Action class so you could display appropriate messages on login page when user gets redirected to it due to time out. However this does not work well when there are pop-up windows: e.g. When user clicks on a hyperlink in a parent browser window, a new pop-up window opens to display information. But when the session has timed out, the pop-up window displays "session time out error" and redirects it log in page. What I intend to achieve is that when the user clicks on the hyperlink and if the session has expired new pop-up window does not open and is the redirected to login page in the parent browser window itself. One possibility is to associate the hyperlink on the page with a form submission and then verify session time out in Action class but then how to open pop-up window from within Action class? Any other possibilities? Any suggestions/pointers will be much appreciated. Regards Chinmay This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Rajat Pandit | [EMAIL PROTECTED] +91 612 3117606 [ Developer and Part Time Human Being] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session time-out in pop-up windows
Chinmay, If you don't want to mess with your URLs or add parameters (and I don't blame you), you can pass the list of popup urls to your filter: AuthFilter com.chinmay.AuthFilter popupUrl1 /infoBox.do popupUrl2 /notice.do You can collect these in your filter ("all init params that start with 'popupUrl'") and respond accordingly. Hubert --- "Rabago, Hubert" <[EMAIL PROTECTED]> wrote: > You'd have to find a way to identify the popup. It could be because of > the requested resource ("myPopup" or any page with "popup") or a special > request parameter which will only be sent by a request for a popup > window ("href='/mycontext/myinfodisplay.do?myActualParam=1&isPopup"). > Either way, the filter will have to be notified somehow that "Hey, this > particular request here is a popup!" > When it does, then you can redirect the popup to a different page which > does nothing but send the parent to a different url and close itself. > > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] > Sent: Monday, November 03, 2003 9:10 AM > To: [EMAIL PROTECTED] > Subject: RE: session time-out in pop-up windows > > > Hubert > > Thanks for this. > > But how would filter recognise that the request was sent by a popup? As > I understand, the process is like: > - pop-up window opens > - Page would read global forward url from the struts config file (the > page to display) > - It will check filter: if "filter pass" is true display url page else > display error page. > > So I am not sure, how Step 3 and then 4 could be implemented. > > > -Original Message- > From: Hubert Rabago [mailto:[EMAIL PROTECTED] > Sent: 03 November 2003 14:50 > To: Struts Users Mailing List > Subject: Re: session time-out in pop-up windows > > Another way might be: > 1. user clicks link for pop-up window, window pops-up > and initiates the web request > 2. Filter intercepts the request and senses that the > session has timed out > 3. Before redirecting, filter recognizes that the > request was sent by a popup, and instead redirects to > a different pop-up page > 4. The session-expired pop-up window shows in the > browser with JS code to (a) redirect the parent page > to the login window and (b) close itself. > > --- [EMAIL PROTECTED] wrote: > > I am using Filters to determine whether session has > > timed out or no and > > redirect user to login page. The implementation > > class extends Action > > class so you could display appropriate messages on > > login page when user > > gets redirected to it due to time out. > > > > > > > > However this does not work well when there are > > pop-up windows: e.g. > > When user clicks on a hyperlink in a parent browser > > window, a new pop-up > > window opens to display information. But when the > > session has timed > > out, the pop-up window displays "session time out > > error" and redirects > > it log in page. What I intend to achieve is that > > when the user clicks > > on the hyperlink and if the session has expired new > > pop-up window does > > not open and is the redirected to login page in the > > parent browser > > window itself. > > > > > > > > One possibility is to associate the hyperlink on the > > page with a form > > submission and then verify session time out in > > Action class but then how > > to open pop-up window from within Action class? > > > > > > > > Any other possibilities? > > > > > > > > Any suggestions/pointers will be much appreciated. > > > > > > > > Regards > > > > > > > > Chinmay > > > > > > > > > > > > > > > > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session time-out in pop-up windows
Rabago, Hubert wrote: You'd have to find a way to identify the popup. It could be because of the requested resource ("myPopup" or any page with "popup") or a special request parameter which will only be sent by a request for a popup window ("href='/mycontext/myinfodisplay.do?myActualParam=1&isPopup"). That's a good idea Hubert. Actually, even if you weren't using filters, you could just test for this "popup" parameter wherever you are doing your active session check. -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session time-out in pop-up windows
You'd have to find a way to identify the popup. It could be because of the requested resource ("myPopup" or any page with "popup") or a special request parameter which will only be sent by a request for a popup window ("href='/mycontext/myinfodisplay.do?myActualParam=1&isPopup"). Either way, the filter will have to be notified somehow that "Hey, this particular request here is a popup!" When it does, then you can redirect the popup to a different page which does nothing but send the parent to a different url and close itself. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, November 03, 2003 9:10 AM To: [EMAIL PROTECTED] Subject: RE: session time-out in pop-up windows Hubert Thanks for this. But how would filter recognise that the request was sent by a popup? As I understand, the process is like: - pop-up window opens - Page would read global forward url from the struts config file (the page to display) - It will check filter: if "filter pass" is true display url page else display error page. So I am not sure, how Step 3 and then 4 could be implemented. -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: 03 November 2003 14:50 To: Struts Users Mailing List Subject: Re: session time-out in pop-up windows Another way might be: 1. user clicks link for pop-up window, window pops-up and initiates the web request 2. Filter intercepts the request and senses that the session has timed out 3. Before redirecting, filter recognizes that the request was sent by a popup, and instead redirects to a different pop-up page 4. The session-expired pop-up window shows in the browser with JS code to (a) redirect the parent page to the login window and (b) close itself. --- [EMAIL PROTECTED] wrote: > I am using Filters to determine whether session has > timed out or no and > redirect user to login page. The implementation > class extends Action > class so you could display appropriate messages on > login page when user > gets redirected to it due to time out. > > > > However this does not work well when there are > pop-up windows: e.g. > When user clicks on a hyperlink in a parent browser > window, a new pop-up > window opens to display information. But when the > session has timed > out, the pop-up window displays "session time out > error" and redirects > it log in page. What I intend to achieve is that > when the user clicks > on the hyperlink and if the session has expired new > pop-up window does > not open and is the redirected to login page in the > parent browser > window itself. > > > > One possibility is to associate the hyperlink on the > page with a form > submission and then verify session time out in > Action class but then how > to open pop-up window from within Action class? > > > > Any other possibilities? > > > > Any suggestions/pointers will be much appreciated. > > > > Regards > > > > Chinmay > > > > > > > > > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session time-out in pop-up windows
Hubert Thanks for this. But how would filter recognise that the request was sent by a popup? As I understand, the process is like: - pop-up window opens - Page would read global forward url from the struts config file (the page to display) - It will check filter: if "filter pass" is true display url page else display error page. So I am not sure, how Step 3 and then 4 could be implemented. -Original Message- From: Hubert Rabago [mailto:[EMAIL PROTECTED] Sent: 03 November 2003 14:50 To: Struts Users Mailing List Subject: Re: session time-out in pop-up windows Another way might be: 1. user clicks link for pop-up window, window pops-up and initiates the web request 2. Filter intercepts the request and senses that the session has timed out 3. Before redirecting, filter recognizes that the request was sent by a popup, and instead redirects to a different pop-up page 4. The session-expired pop-up window shows in the browser with JS code to (a) redirect the parent page to the login window and (b) close itself. --- [EMAIL PROTECTED] wrote: > I am using Filters to determine whether session has > timed out or no and > redirect user to login page. The implementation > class extends Action > class so you could display appropriate messages on > login page when user > gets redirected to it due to time out. > > > > However this does not work well when there are > pop-up windows: e.g. > When user clicks on a hyperlink in a parent browser > window, a new pop-up > window opens to display information. But when the > session has timed > out, the pop-up window displays "session time out > error" and redirects > it log in page. What I intend to achieve is that > when the user clicks > on the hyperlink and if the session has expired new > pop-up window does > not open and is the redirected to login page in the > parent browser > window itself. > > > > One possibility is to associate the hyperlink on the > page with a form > submission and then verify session time out in > Action class but then how > to open pop-up window from within Action class? > > > > Any other possibilities? > > > > Any suggestions/pointers will be much appreciated. > > > > Regards > > > > Chinmay > > > > > > > > > > > > This message is for the designated recipient only > and may contain privileged, proprietary, or > otherwise private information. If you have received > it in error, please notify the sender immediately > and delete the original. Any other use of the email > by you is prohibited. > __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: session time-out in pop-up windows
Another way might be: 1. user clicks link for pop-up window, window pops-up and initiates the web request 2. Filter intercepts the request and senses that the session has timed out 3. Before redirecting, filter recognizes that the request was sent by a popup, and instead redirects to a different pop-up page 4. The session-expired pop-up window shows in the browser with JS code to (a) redirect the parent page to the login window and (b) close itself. --- [EMAIL PROTECTED] wrote: > I am using Filters to determine whether session has > timed out or no and > redirect user to login page. The implementation > class extends Action > class so you could display appropriate messages on > login page when user > gets redirected to it due to time out. > > > > However this does not work well when there are > pop-up windows: e.g. > When user clicks on a hyperlink in a parent browser > window, a new pop-up > window opens to display information. But when the > session has timed > out, the pop-up window displays "session time out > error" and redirects > it log in page. What I intend to achieve is that > when the user clicks > on the hyperlink and if the session has expired new > pop-up window does > not open and is the redirected to login page in the > parent browser > window itself. > > > > One possibility is to associate the hyperlink on the > page with a form > submission and then verify session time out in > Action class but then how > to open pop-up window from within Action class? > > > > Any other possibilities? > > > > Any suggestions/pointers will be much appreciated. > > > > Regards > > > > Chinmay > > > > > > > > > > > > This message is for the designated recipient only > and may contain privileged, proprietary, or > otherwise private information. If you have received > it in error, please notify the sender immediately > and delete the original. Any other use of the email > by you is prohibited. > __ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]