Datatable Partial Response Redirect

UI Components for JSF
rsaravind
Posts: 4
Joined: 17 Dec 2010, 04:22

17 Dec 2010, 04:55

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.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

17 Dec 2010, 10:50

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
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

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

17 Dec 2010, 11:42

I agree with Oleg, it is user's responsibility to implement this.

rsaravind
Posts: 4
Joined: 17 Dec 2010, 04:22

14 Feb 2011, 08:06

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.

User avatar
Oleg
Expert Member
Posts: 3805
Joined: 02 Oct 2009, 09:41
Location: Germany, Black Forest

14 Feb 2011, 13:53

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

raziel
Posts: 48
Joined: 11 Feb 2010, 20:45

14 Feb 2011, 14:47

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

rsaravind
Posts: 4
Joined: 17 Dec 2010, 04:22

15 Feb 2011, 13:47

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.

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

15 Feb 2011, 14:18

You can file an enhancement request in our issue tracker.

rsaravind
Posts: 4
Joined: 17 Dec 2010, 04:22

15 Feb 2011, 17:10

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

jndl
Posts: 2
Joined: 19 Jan 2011, 12:32

24 Feb 2011, 17:04

Hi,

I would like to know if you have defined a timeline for this (it is critical for me), and if you have any idea for a workaround until it is fixed ?
Thanks.

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests