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/04/01 14:07:45 UTC

Re: post-redirect-get in Firefox

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