Trinidad 1.0.7 PPR after Timeout problem

View: New views
6 Messages — Rating Filter:   Alert me  

Trinidad 1.0.7 PPR after Timeout problem

by Pedro Calcao :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Greetings,

I have recently upgraded an application from using Trinidad release 1.0.1 to 1.0.7.

Back in 1.0.1 I had to use a workaround for our TimeoutFilter to redirect the user to the login page when a PPR request ocurred after the session had timeout. Since that version still used iframes, it involved having a page that tested to see if it was inside the iFrame, reset it's location, and then redirect to the main login page, through "location.href=myLoginPage.jsf".

Now that the PPR mechanism uses "true" AJAX, is there a way to redirect to a page after a timeout has been detected?

If I try to do a simple redirect in the filter, I get the javascript errors:

["Invalid PPR response. The response-headers were:\nCache-Control: no-cache="set-cookie"\nDate: Tue, 06 ..."]
["Error ", TypeError: a5 has no properties message=a5 has no properties, " delivering XML request status changed to ", function(...

since the javascript handling the response is expecting a <?Tr-XHR-Response-Type ?>, as far as I can tell.

Is there a standard mechanism to handle this situation, or any workaround for sending a response that can be handled correctly by the PPR handling mechanism and results in a redirect?

Thank you in advance,

Pedro


--
Os melhores cumprimentos,

Pedro Calção

Antwort: Trinidad 1.0.7 PPR after Timeout problem

by wolfgang.toepfer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

You might want to use the polling component of Trinidad.

Best wishes
Wolfgang



"Pedro Calcao" <pcalcao@...>
Gesendet von: calcao.pedro@...

06.05.2008 16:09
Bitte antworten an
"MyFaces Discussion" <users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Trinidad 1.0.7 PPR after Timeout problem





Greetings,

I have recently upgraded an application from using Trinidad release 1.0.1 to
1.0.7.

Back in 1.0.1 I had to use a workaround for our TimeoutFilter to redirect the user to the login page when a PPR request ocurred after the session had timeout. Since that version still used iframes, it involved having a page that tested to see if it was inside the iFrame, reset it's location, and then redirect to the main login page, through "location.href=myLoginPage.jsf".

Now that the PPR mechanism uses "true" AJAX, is there a way to redirect to a page after a timeout has been detected?

If I try to do a simple redirect in the filter, I get the javascript errors:

["Invalid PPR response. The response-headers were:\nCache-Control: no-cache="set-cookie"\nDate: Tue, 06 ..."]
["Error ", TypeError: a5 has no properties message=a5 has no properties, " delivering XML request status changed to ", function(...


since the javascript handling the response is expecting a <?Tr-XHR-Response-Type ?>, as far as I can tell.

Is there a standard mechanism to handle this situation, or any workaround for sending a response that can be handled correctly by the PPR handling mechanism and results in a redirect?

Thank you in advance,

Pedro


--
Os melhores cumprimentos,

Pedro Calção


Re: Trinidad 1.0.7 PPR after Timeout problem

by Pedro Calcao :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

Thank you for the fast reply.

I might not have understood exactly your ideia, but wouldn't the polling serve only to keep the session active?


On Tue, May 6, 2008 at 3:39 PM, <wolfgang.toepfer@...> wrote:

Hi,

You might want to use the polling component of Trinidad.

Best wishes
Wolfgang



"Pedro Calcao" <pcalcao@...>
Gesendet von: calcao.pedro@...

06.05.2008 16:09

Bitte antworten an
"MyFaces Discussion" <users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Trinidad 1.0.7 PPR after Timeout problem





Greetings,

I have recently upgraded an application from using Trinidad release 1.0.1 to
1.0.7.

Back in 1.0.1 I had to use a workaround for our TimeoutFilter to redirect the user to the login page when a PPR request ocurred after the session had timeout. Since that version still used iframes, it involved having a page that tested to see if it was inside the iFrame, reset it's location, and then redirect to the main login page, through "location.href=myLoginPage.jsf".

Now that the PPR mechanism uses "true" AJAX, is there a way to redirect to a page after a timeout has been detected?

If I try to do a simple redirect in the filter, I get the javascript errors:

["Invalid PPR response. The response-headers were:\nCache-Control: no-cache="set-cookie"\nDate: Tue, 06 ..."]
["Error ", TypeError: a5 has no properties message=a5 has no properties, " delivering XML request status changed to ", function(...


since the javascript handling the response is expecting a <?Tr-XHR-Response-Type ?>, as far as I can tell.

Is there a standard mechanism to handle this situation, or any workaround for sending a response that can be handled correctly by the PPR handling mechanism and results in a redirect?

Thank you in advance,

Pedro


--
Os melhores cumprimentos,

Pedro Calção




--
Os melhores cumprimentos,

Pedro Calção

Antwort: Re: Trinidad 1.0.7 PPR after Timeout problem

by wolfgang.toepfer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hi,

E.g. you can use the polling component to navigate to the login screen after your session experied,
 which you may calculate on the basis of the rsp. user's last access. and the current time.

You can insert this code in the poller's listener method.

        public void poll(PollEvent event) { //TODO insert here :) }

Best wishes
Wolfgang.



"Pedro Calcao" <pcalcao@...>
Gesendet von: calcao.pedro@...

06.05.2008 16:45
Bitte antworten an
"MyFaces Discussion" <users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Re: Trinidad 1.0.7 PPR after Timeout problem





Hi,

Thank you for the fast reply.

I might not have understood exactly your ideia, but wouldn't the polling serve only to keep the session active?


On Tue, May 6, 2008 at 3:39 PM, <wolfgang.toepfer@...> wrote:

Hi,


You might want to use the polling component of Trinidad.


Best wishes

Wolfgang



"Pedro Calcao" <pcalcao@...>
Gesendet von:
calcao.pedro@...

06.05.2008 16:09


Bitte antworten an
"MyFaces Discussion" <
users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Trinidad 1.0.7 PPR after Timeout problem







Greetings,

I have recently upgraded an application from using Trinidad release 1.0.1 to
1.0.7.

Back in 1.0.1 I had to use a workaround for our TimeoutFilter to redirect the user to the login page when a PPR request ocurred after the session had timeout. Since that version still used iframes, it involved having a page that tested to see if it was inside the iFrame, reset it's location, and then redirect to the main login page, through "location.href=myLoginPage.jsf".

Now that the PPR mechanism uses "true" AJAX, is there a way to redirect to a page after a timeout has been detected?

If I try to do a simple redirect in the filter, I get the javascript errors:

["Invalid PPR response. The response-headers were:\nCache-Control: no-cache="set-cookie"\nDate: Tue, 06 ..."]
["Error ", TypeError: a5 has no properties message=a5 has no properties, " delivering XML request status changed to ", function(...

since the javascript handling the response is expecting a <?Tr-XHR-Response-Type ?>, as far as I can tell.

Is there a standard mechanism to handle this situation, or any workaround for sending a response that can be handled correctly by the PPR handling mechanism and results in a redirect?

Thank you in advance,

Pedro


--
Os melhores cumprimentos,

Pedro Calção




--
Os melhores cumprimentos,

Pedro Calção


Re: Re: Trinidad 1.0.7 PPR after Timeout problem

by Pedro Calcao :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi again,

I think I understand what you propose, but I believe this solution doesn't work correctly in some situations, for exemple, when the session actually timed out in the time between two polls, and the user, for instance, tries to navigate to another page of a tr:table.

This can happen not just when the session expires, but, for instance, if the application happens to be redeployed on the server (not a very common scenario, but still likely in the early stages of an application being used in production environment).

I believe that there should be a generic way for the Trinidad infrastructure to handle a case like this, since handling session timeouts is a fairly simple case that should be transparent no matter if the request is a full page refresh, or a PPR.

Thank you for your responses so far :).

On Tue, May 6, 2008 at 4:02 PM, <wolfgang.toepfer@...> wrote:

Hi,

E.g. you can use the polling component to navigate to the login screen after your session experied,
 which you may calculate on the basis of the rsp. user's last access. and the current time.

You can insert this code in the poller's listener method.

        public void poll(PollEvent event) { //TODO insert here :) }

Best wishes
Wolfgang.



"Pedro Calcao" <pcalcao@...>
Gesendet von: calcao.pedro@...

06.05.2008 16:45

Bitte antworten an
"MyFaces Discussion" <users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Re: Trinidad 1.0.7 PPR after Timeout problem





Hi,

Thank you for the fast reply.

I might not have understood exactly your ideia, but wouldn't the polling serve only to keep the session active?


On Tue, May 6, 2008 at 3:39 PM, <wolfgang.toepfer@...> wrote:

Hi,


You might want to use the polling component of Trinidad.


Best wishes

Wolfgang



"Pedro Calcao" <pcalcao@...>
Gesendet von:
calcao.pedro@...

06.05.2008 16:09


Bitte antworten an
"MyFaces Discussion" <
users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Trinidad 1.0.7 PPR after Timeout problem







Greetings,

I have recently upgraded an application from using Trinidad release 1.0.1 to
1.0.7.

Back in 1.0.1 I had to use a workaround for our TimeoutFilter to redirect the user to the login page when a PPR request ocurred after the session had timeout. Since that version still used iframes, it involved having a page that tested to see if it was inside the iFrame, reset it's location, and then redirect to the main login page, through "location.href=myLoginPage.jsf".

Now that the PPR mechanism uses "true" AJAX, is there a way to redirect to a page after a timeout has been detected?

If I try to do a simple redirect in the filter, I get the javascript errors:

["Invalid PPR response. The response-headers were:\nCache-Control: no-cache="set-cookie"\nDate: Tue, 06 ..."]
["Error ", TypeError: a5 has no properties message=a5 has no properties, " delivering XML request status changed to ", function(...

since the javascript handling the response is expecting a <?Tr-XHR-Response-Type ?>, as far as I can tell.

Is there a standard mechanism to handle this situation, or any workaround for sending a response that can be handled correctly by the PPR handling mechanism and results in a redirect?

Thank you in advance,

Pedro


--
Os melhores cumprimentos,

Pedro Calção




--
Os melhores cumprimentos,

Pedro Calção




--
Os melhores cumprimentos,

Pedro Calção

Antwort: Re: Re: Trinidad 1.0.7 PPR after Timeout problem

by wolfgang.toepfer :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yes there is a JIRA issue filed some time ago also descirbing more details as to how Trinidad would need to be changed for that



"Pedro Calcao" <pcalcao@...>
Gesendet von: calcao.pedro@...

06.05.2008 17:46
Bitte antworten an
"MyFaces Discussion" <users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Re: Re: Trinidad 1.0.7 PPR after Timeout problem





Hi again,

I think I understand what you propose, but I believe this solution doesn't work correctly in some situations, for exemple, when the session actually timed out in the time between two polls, and the user, for instance, tries to navigate to another page of a tr:table.

This can happen not just when the session expires, but, for instance, if the application happens to be redeployed on the server (not a very common scenario, but still likely in the early stages of an application being used in production environment).

I believe that there should be a generic way for the Trinidad infrastructure to handle a case like this, since handling session timeouts is a fairly simple case that should be transparent no matter if the request is a full page refresh, or a PPR.

Thank you for your responses so far :).

On Tue, May 6, 2008 at 4:02 PM, <wolfgang.toepfer@...> wrote:

Hi,


E.g. you can use the polling component to navigate to the login screen after your session experied,

which you may calculate on the basis of the rsp. user's last access. and the current time.


You can insert this code in the poller's listener method.


       
public void poll(PollEvent event) { //TODO insert here :) }

Best wishes

Wolfgang.



"Pedro Calcao" <pcalcao@...>
Gesendet von:
calcao.pedro@...

06.05.2008 16:45


Bitte antworten an
"MyFaces Discussion" <
users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Re: Trinidad 1.0.7 PPR after Timeout problem







Hi,

Thank you for the fast reply.

I might not have understood exactly your ideia, but wouldn't the polling serve only to keep the session active?


On Tue, May 6, 2008 at 3:39 PM, <
wolfgang.toepfer@...> wrote:

Hi,


You might want to use the polling component of Trinidad.


Best wishes

Wolfgang


"Pedro Calcao" <pcalcao@...>
Gesendet von:
calcao.pedro@...

06.05.2008 16:09


Bitte antworten an
"MyFaces Discussion" <
users@...>

An
"MyFaces Discussion" <users@...>
Kopie
Thema
Trinidad 1.0.7 PPR after Timeout problem









Greetings,

I have recently upgraded an application from using Trinidad release 1.0.1 to
1.0.7.

Back in 1.0.1 I had to use a workaround for our TimeoutFilter to redirect the user to the login page when a PPR request ocurred after the session had timeout. Since that version still used iframes, it involved having a page that tested to see if it was inside the iFrame, reset it's location, and then redirect to the main login page, through "location.href=myLoginPage.jsf".

Now that the PPR mechanism uses "true" AJAX, is there a way to redirect to a page after a timeout has been detected?

If I try to do a simple redirect in the filter, I get the javascript errors:

["Invalid PPR response. The response-headers were:\nCache-Control: no-cache="set-cookie"\nDate: Tue, 06 ..."]
["Error ", TypeError: a5 has no properties message=a5 has no properties, " delivering XML request status changed to ", function(...

since the javascript handling the response is expecting a <?Tr-XHR-Response-Type ?>, as far as I can tell.

Is there a standard mechanism to handle this situation, or any workaround for sending a response that can be handled correctly by the PPR handling mechanism and results in a redirect?

Thank you in advance,

Pedro


--
Os melhores cumprimentos,

Pedro Calção



--
Os melhores cumprimentos,

Pedro Calção




--
Os melhores cumprimentos,

Pedro Calção

LightInTheBox - Buy quality products at wholesale price