You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Hardy <ah...@cyberspaceroad.com> on 2009/03/31 03:59:01 UTC

post-redirect-get in Firefox

I think this is likely to be nothing to do with struts but rather with firefox, 
however trawling the net for firefox info on the subject hasn't yielded anything 
interesting.

I noticed a while back that my redirects are not replacing the history in the 
browser - firefox in particular, but not opera.

If I submit a form, then the redirect response is retured and the browser 
fetches the appropriate page.

Normally if I hit Refresh, it should just refetch the last page. However Firefox 
is ignoring the redirect and actually resubmitting the form after showing the 
warning / confirmation dialog.

Is this just me or has anyone else got this issue too?

Thanks
Adam


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: post-redirect-get in Firefox

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
Found out how to reproduce it.

If I try over and over to submit a form, it fails several times and is 
repeatedly redisplayed with an error message. In my case "primary key is 
duplicate" because I keep forgetting to update it manually when I mess around 
like this in dev.

Since the primary key is incremented each time, on the fifth time the primary 
key reaches 5 and is valid in my DB, so it submits. This is redirected to the 
list of items, and it displays the "status saved" message.

If I then hit refresh, it does it again! The resubmit dialog shows and if I hit 
OK it hits the DB again and does another redirect and another confirmation 
status saved.

Strange one. A firefox bug probably. I'm going to upgrade to FF3 soon so I'll 
find out if the issue has been resolved.

Regards
Adam

Adam Hardy on 31/03/09 12:18, wrote:
> GET HTTP 302 according to httpheaders
> 
> It looks fine and should be fine, assuming the struts2 redirect 
> resulttype is OK.
> 
> But somehow firefox seems to be too clever and appears to be breaking 
> the standard browser contract to replace the POST with the GET
> 
> To confuse me more, it is only doing this on one server on my dev box. 
> The same page on the deployment server works fine - arg!
> 
> Actually now that I check, it's not doing it on the dev server either. 
> It looks like I can't reproduce it. How annoying!
> 
> So it seems to be intermittent - possibly something bad that I 
> intermittently do without realising. But I did spend an hour trying to 
> solve it last night without any luck.
> 
> Martin Gainty on 31/03/09 03:46, wrote:
>> In Firefox
>> so if I am on Investran and am redirected to cyberspaceroad
>> I then (login) to <welcome-file> on cyberspaceroad on refresh I am 
>> redirected to original Investran
>>
>> Can you see which redirect code is returned (301,307) and which 
>> method(POST/GET)
>> ?
>>> Date: Tue, 31 Mar 2009 02:59:01 +0100
>>> From: ahardy.struts@cyberspaceroad.com
>>> To: user@struts.apache.org
>>> Subject: post-redirect-get in Firefox
>>>
>>>
>>> I think this is likely to be nothing to do with struts but rather 
>>> with firefox, however trawling the net for firefox info on the 
>>> subject hasn't yielded anything interesting.
>>>
>>> I noticed a while back that my redirects are not replacing the 
>>> history in the browser - firefox in particular, but not opera.
>>>
>>> If I submit a form, then the redirect response is retured and the 
>>> browser fetches the appropriate page.
>>>
>>> Normally if I hit Refresh, it should just refetch the last page. 
>>> However Firefox is ignoring the redirect and actually resubmitting 
>>> the form after showing the warning / confirmation dialog.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: post-redirect-get in Firefox

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
GET HTTP 302 according to httpheaders

It looks fine and should be fine, assuming the struts2 redirect resulttype is OK.

But somehow firefox seems to be too clever and appears to be breaking the 
standard browser contract to replace the POST with the GET

To confuse me more, it is only doing this on one server on my dev box. The same 
page on the deployment server works fine - arg!

Actually now that I check, it's not doing it on the dev server either. It looks 
like I can't reproduce it. How annoying!

So it seems to be intermittent - possibly something bad that I intermittently do 
without realising. But I did spend an hour trying to solve it last night without 
any luck.

Regards
Adam


Martin Gainty on 31/03/09 03:46, wrote:
> In Firefox
> so if I am on Investran and am redirected to cyberspaceroad
> I then (login) to <welcome-file> on cyberspaceroad 
> on refresh I am redirected to original Investran
> 
> Can you see which redirect code is returned (301,307) and which method(POST/GET)
> ?
>> Date: Tue, 31 Mar 2009 02:59:01 +0100
>> From: ahardy.struts@cyberspaceroad.com
>> To: user@struts.apache.org
>> Subject: post-redirect-get in Firefox
>>
>>
>> I think this is likely to be nothing to do with struts but rather with firefox, 
>> however trawling the net for firefox info on the subject hasn't yielded anything 
>> interesting.
>>
>> I noticed a while back that my redirects are not replacing the history in the 
>> browser - firefox in particular, but not opera.
>>
>> If I submit a form, then the redirect response is retured and the browser 
>> fetches the appropriate page.
>>
>> Normally if I hit Refresh, it should just refetch the last page. However Firefox 
>> is ignoring the redirect and actually resubmitting the form after showing the 
>> warning / confirmation dialog.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: post-redirect-get in Firefox

Posted by Martin Gainty <mg...@hotmail.com>.
In Firefox
so if I am on Investran and am redirected to cyberspaceroad
I then (login) to <welcome-file> on cyberspaceroad 
on refresh I am redirected to original Investran

Can you see which redirect code is returned (301,307) and which method(POST/GET)
?
Martin 
______________________________________________ 
Disclaimer and confidentiality note 
This message is confidential and may be privileged. If you are not the intended recipient, we kindly ask you to  please inform the sender. Any unauthorised dissemination or copying hereof is prohibited. This message serves for information purposes only and shall not have any legally binding effect. Given that e-mails can easily be subject to manipulation, we can not accept any liability for the content provided.






> Date: Tue, 31 Mar 2009 02:59:01 +0100
> From: ahardy.struts@cyberspaceroad.com
> To: user@struts.apache.org
> Subject: post-redirect-get in Firefox
> 
> 
> I think this is likely to be nothing to do with struts but rather with firefox, 
> however trawling the net for firefox info on the subject hasn't yielded anything 
> interesting.
> 
> I noticed a while back that my redirects are not replacing the history in the 
> browser - firefox in particular, but not opera.
> 
> If I submit a form, then the redirect response is retured and the browser 
> fetches the appropriate page.
> 
> Normally if I hit Refresh, it should just refetch the last page. However Firefox 
> is ignoring the redirect and actually resubmitting the form after showing the 
> warning / confirmation dialog.
> 
> Is this just me or has anyone else got this issue too?
> 
> Thanks
> Adam
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 

_________________________________________________________________
Express your personality in color! Preview and select themes for HotmailĀ®.
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_MSGTX_WL_HM_express_032009#colortheme