RE: struts2 interceptor session timeout with ajax
MG>pls see below > From: lukaszlen...@apache.org > Date: Wed, 30 Mar 2016 07:59:28 +0200 > Subject: Re: struts2 interceptor session timeout with ajax > To: user@struts.apache.org > > I think you must use `onSuccessTopics` instead of `onErrorTopics` - > returning 403 doesn't mean an error MG>if browser client sees 403 you will want to redirect to a Secure SSL3/TLS connection index.jsp default page with username/password fields MG>FYI: tomcat Connector can define a secure port for redirects on the connection via attribute redirectPort="8443" http://stackoverflow.com/questions/24736543/tomcat-7-automatically-redirect-https-requests-to-port-8443 > > 2016-03-29 21:59 GMT+02:00 fea jabi <zy...@hotmail.com>: > > Thanks, it worked but now trying this and not sure how to fix this. > > > > Have a on a page. > > After session timeout trying to click on another tab of tabbed panel should > > redirect the user to login page. > > panel not firing the onErrorTopics. The javascript function is > > not getting called. The server is sending result 403. Please see below and > > guide me on how to fix this issue. I am seeing in fire bug that the 403 > > error is thrown but I am unable to catch it in jsp. Need help with the same. > > > > struts.xml > > > > > class="com.xxx.secondPanelAction"> > > > > > > /jsp/secondPanel.jsp > > > > 403 > > User session expired > > > > > > > > > > jsp > > > > > hide="'fade'" collapsible="true" sortable="true" onErrorTopics="loadError"> > > > onErrorTopics="loadError"/> > > > onErrorTopics="loadError"/> > > > > > > > > $(document).ready(function() { > > $.subscribe('loadError', function(event, status, data) { > > alert('in error'); > > var status1 = event.status; > > > > if(status1 == 403 ) { > > window.location.href = "/Sample/login.action"; > > } > > }); > > > > > > > > > > > > > > > > > > > > From: Lukasz Lenart <lukaszlen...@apache.org> > > Sent: Friday, March 11, 2016 2:21 PM > > To: Struts Users Mailing List > > Subject: Re: struts2 interceptor session timeout with ajax > > > > It won't work that way, when using Ajax you must use Ajax to redirect > > to a login page. You can use something like this > > > > http://cypressnorth.com/programming/global-ajax-error-handling-with-jquery/ > > > > so your interceptor must return 403 status code (it can return also an > > url to login page to redirect to) and you must handle redirect on > > client side > > > > > > Regards > > -- > > Łukasz > > + 48 606 323 122 http://www.lenart.org.pl/ > > > > 2016-03-11 15:31 GMT+01:00 fea jabi <zy...@hotmail.com>: > >> Need help with this please. > >> > >> > >> From: fea jabi <zy...@hotmail.com> > >> Sent: Wednesday, March 9, 2016 10:51 AM > >> To: user@struts.apache.org > >> Subject: struts2 interceptor session timeout with ajax > >> > >> Have jquery tabbed panel in a jsp page which has a button to Save the form > >> in the tabbed panel which is making an ajax call and is working fine. > >> > >> Now trying to implement the session management for all requests in the > >> application and imlemented the new interceptor to perform the same. Having > >> issue with session management with the ajax calls. Have the below package > >> for ajax requests in which configured the new interceptor created and the > >> default interceptor. But, the below is not redirecting to the login page > >> instead opening the popup with login page html in it. what am I missing > >> here? > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> true > >> > >> true > >> > >> jsonResult > >> > >> > >> > >> > >> > >> appLogin > >> > >> / > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> - > >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > >> For additional commands, e-mail: user-h...@struts.apache.org > >> > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > > > - > > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > > For additional commands, e-mail: user-h...@struts.apache.org > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org >
Re: struts2 interceptor session timeout with ajax
I think you must use `onSuccessTopics` instead of `onErrorTopics` - returning 403 doesn't mean an error 2016-03-29 21:59 GMT+02:00 fea jabi <zy...@hotmail.com>: > Thanks, it worked but now trying this and not sure how to fix this. > > Have a on a page. > After session timeout trying to click on another tab of tabbed panel should > redirect the user to login page. > panel not firing the onErrorTopics. The javascript function is > not getting called. The server is sending result 403. Please see below and > guide me on how to fix this issue. I am seeing in fire bug that the 403 error > is thrown but I am unable to catch it in jsp. Need help with the same. > > struts.xml > > > > > /jsp/secondPanel.jsp > > 403 > User session expired > > > > > jsp > > hide="'fade'" collapsible="true" sortable="true" onErrorTopics="loadError"> > onErrorTopics="loadError"/> > onErrorTopics="loadError"/> > > > > $(document).ready(function() { > $.subscribe('loadError', function(event, status, data) { > alert('in error'); > var status1 = event.status; > > if(status1 == 403 ) { > window.location.href = "/Sample/login.action"; > } > }); > > > > > > > > > > From: Lukasz Lenart <lukaszlen...@apache.org> > Sent: Friday, March 11, 2016 2:21 PM > To: Struts Users Mailing List > Subject: Re: struts2 interceptor session timeout with ajax > > It won't work that way, when using Ajax you must use Ajax to redirect > to a login page. You can use something like this > > http://cypressnorth.com/programming/global-ajax-error-handling-with-jquery/ > > so your interceptor must return 403 status code (it can return also an > url to login page to redirect to) and you must handle redirect on > client side > > > Regards > -- > Łukasz > + 48 606 323 122 http://www.lenart.org.pl/ > > 2016-03-11 15:31 GMT+01:00 fea jabi <zy...@hotmail.com>: >> Need help with this please. >> >> >> From: fea jabi <zy...@hotmail.com> >> Sent: Wednesday, March 9, 2016 10:51 AM >> To: user@struts.apache.org >> Subject: struts2 interceptor session timeout with ajax >> >> Have jquery tabbed panel in a jsp page which has a button to Save the form >> in the tabbed panel which is making an ajax call and is working fine. >> >> Now trying to implement the session management for all requests in the >> application and imlemented the new interceptor to perform the same. Having >> issue with session management with the ajax calls. Have the below package >> for ajax requests in which configured the new interceptor created and the >> default interceptor. But, the below is not redirecting to the login page >> instead opening the popup with login page html in it. what am I missing here? >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> true >> >> true >> >> jsonResult >> >> >> >> >> >> appLogin >> >> / >> >> >> >> >> >> >> >> >> >> >> - >> To unsubscribe, e-mail: user-unsubscr...@struts.apache.org >> For additional commands, e-mail: user-h...@struts.apache.org >> > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts2 interceptor session timeout with ajax
Thanks, it worked but now trying this and not sure how to fix this. Have a on a page. After session timeout trying to click on another tab of tabbed panel should redirect the user to login page. panel not firing the onErrorTopics. The javascript function is not getting called. The server is sending result 403. Please see below and guide me on how to fix this issue. I am seeing in fire bug that the 403 error is thrown but I am unable to catch it in jsp. Need help with the same. struts.xml /jsp/secondPanel.jsp 403 User session expired jsp $(document).ready(function() { $.subscribe('loadError', function(event, status, data) { alert('in error'); var status1 = event.status; if(status1 == 403 ) { window.location.href = "/Sample/login.action"; } }); From: Lukasz Lenart <lukaszlen...@apache.org> Sent: Friday, March 11, 2016 2:21 PM To: Struts Users Mailing List Subject: Re: struts2 interceptor session timeout with ajax It won't work that way, when using Ajax you must use Ajax to redirect to a login page. You can use something like this http://cypressnorth.com/programming/global-ajax-error-handling-with-jquery/ so your interceptor must return 403 status code (it can return also an url to login page to redirect to) and you must handle redirect on client side Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ 2016-03-11 15:31 GMT+01:00 fea jabi <zy...@hotmail.com>: > Need help with this please. > > > From: fea jabi <zy...@hotmail.com> > Sent: Wednesday, March 9, 2016 10:51 AM > To: user@struts.apache.org > Subject: struts2 interceptor session timeout with ajax > > Have jquery tabbed panel in a jsp page which has a button to Save the form in > the tabbed panel which is making an ajax call and is working fine. > > Now trying to implement the session management for all requests in the > application and imlemented the new interceptor to perform the same. Having > issue with session management with the ajax calls. Have the below package for > ajax requests in which configured the new interceptor created and the default > interceptor. But, the below is not redirecting to the login page instead > opening the popup with login page html in it. what am I missing here? > > > > > > > > > > > > > > > > > > > > > > > > > > true > > true > > jsonResult > > > > > > appLogin > > / > > > > > > > > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts2 interceptor session timeout with ajax
It won't work that way, when using Ajax you must use Ajax to redirect to a login page. You can use something like this http://cypressnorth.com/programming/global-ajax-error-handling-with-jquery/ so your interceptor must return 403 status code (it can return also an url to login page to redirect to) and you must handle redirect on client side Regards -- Łukasz + 48 606 323 122 http://www.lenart.org.pl/ 2016-03-11 15:31 GMT+01:00 fea jabi: > Need help with this please. > > > From: fea jabi > Sent: Wednesday, March 9, 2016 10:51 AM > To: user@struts.apache.org > Subject: struts2 interceptor session timeout with ajax > > Have jquery tabbed panel in a jsp page which has a button to Save the form in > the tabbed panel which is making an ajax call and is working fine. > > Now trying to implement the session management for all requests in the > application and imlemented the new interceptor to perform the same. Having > issue with session management with the ajax calls. Have the below package for > ajax requests in which configured the new interceptor created and the default > interceptor. But, the below is not redirecting to the login page instead > opening the popup with login page html in it. what am I missing here? > > > > > > > > > > > > > > > > > > > > > > > > > > true > > true > > jsonResult > > > > > > appLogin > > / > > > > > > > > > > > - > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts2 interceptor session timeout with ajax
Need help with this please. From: fea jabiSent: Wednesday, March 9, 2016 10:51 AM To: user@struts.apache.org Subject: struts2 interceptor session timeout with ajax Have jquery tabbed panel in a jsp page which has a button to Save the form in the tabbed panel which is making an ajax call and is working fine. Now trying to implement the session management for all requests in the application and imlemented the new interceptor to perform the same. Having issue with session management with the ajax calls. Have the below package for ajax requests in which configured the new interceptor created and the default interceptor. But, the below is not redirecting to the login page instead opening the popup with login page html in it. what am I missing here? true true jsonResult appLogin / - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org