Datatable Partial Response Redirect
After session expires on an ajax request from a datable for sorting/pagination/filtering when a partial response with redirect url is returned it does not cause a redirect to the login page. I guess currently only for submit button partial response redirect is handled. But this should be handled for any component.
Hi,
It's your responsibility and not PF to do a redirect after session expires. I could archieve that with this approach: http://ovaraksin.blogspot.com/2010/10/j ... meout.html
It's your responsibility and not PF to do a redirect after session expires. I could archieve that with this approach: http://ovaraksin.blogspot.com/2010/10/j ... meout.html
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
I agree with Oleg, it is user's responsibility to implement this.
The application handles Session expiration and sends redirect response. In case of non ajax request browser handles redirect response from server. But in case of ajax request from a datatable, for pagination or sorting, when session expires, a partial response with the redirect tag is sent as per JSF 2 spec by the application. Here JSF components should handle the partial response with redirect element resulting in a request to the redirected URL. This is not happening in primefaces datatable for pagination, sorting etc.
Do you mean application should handle this by having custom javascript code to do a redirect for the redirect url in partial response? I guess it is the responsibility of component to understand redirect partial response.
Do you mean application should handle this by having custom javascript code to do a redirect for the redirect url in partial response? I guess it is the responsibility of component to understand redirect partial response.
Okey, you meant it doesn't work for datable sorting / filter / paging. What response looks like in this case after session timeout? Can you post the response text (look in firebug)?
PrimeFaces Cookbook (2. edition): http://ova2.github.io/primefaces-cookbook/ Learning Angular UI Development with PrimeNG: https://github.com/ova2/angular-develop ... th-primeng Blog: https://medium.com/@OlegVaraksin
I dont know how it would coast in terms of work to primefaces team to add an atribute such as "expireUrlRedirect" to each component or add a new component(ajaxStatus?) which would listen to ajax request and redirect when session expires but its a PITA to us handle these cases as discussed here http://primefaces.prime.com.tr/forum/vi ... 1&start=10
I would like to thank primefaces team for all your efforts, in making such a great JSF component library. I really appreciate your interest to understand the problem. This is a very essential and critical fix required. I have given below further more information as requested. Please do let let me know your comments. Thanks in advance.
AJAX Response for Sorting a datatable column, after session has expired.
<?xml version='1.0' encoding='UTF-8'?><partial-response><redirect url="http://localhost:8080/webapp/login.html ... l-response>
Expected:
Request to Redirect URL
Actual:
Nothing. Screen/page remains same. No change in the displayed page.
For the same scenario if a submit button for edit in a cell is clicked, primefaces handles the same above response and it gets redirected to login page properly.
Fix: This could be a simple fix in the datatable.js. But the same has to be done for every component as well, which support AJAX.
AJAX Response for Sorting a datatable column, after session has expired.
<?xml version='1.0' encoding='UTF-8'?><partial-response><redirect url="http://localhost:8080/webapp/login.html ... l-response>
Expected:
Request to Redirect URL
Actual:
Nothing. Screen/page remains same. No change in the displayed page.
For the same scenario if a submit button for edit in a cell is clicked, primefaces handles the same above response and it gets redirected to login page properly.
Fix: This could be a simple fix in the datatable.js. But the same has to be done for every component as well, which support AJAX.
-
- Prime
- Posts: 18616
- Joined: 05 Jan 2009, 00:21
- Location: Cybertron
- Contact:
You can file an enhancement request in our issue tracker.
I have created a new issue. But it appears as new feature, please change the type to enhancement and take it forward. I really appreciate your effort. Thanks a lot again.
Issue 1742: Datable Partial Ajax Response to Redirect is not working in Pagination, Sorting, Filtering
Thanks
Aravind
Issue 1742: Datable Partial Ajax Response to Redirect is not working in Pagination, Sorting, Filtering
Thanks
Aravind
-
- Information
-
Who is online
Users browsing this forum: No registered users and 15 guests