Never Knew Domino Used the PRG Method of Form Submission
There's a new blog on the block. It's by the creator of HTTPWatch and is at blog.httpwatch.com. It promises to be good as he obviously knows his stuff when it comes to browser behaviour and HTTP methods/performance.
His first post about breaking the back button was interesting to read as a Domino developer.
In it he talks about a way of avoiding HTML being returned directly in response to a form's POST submission. The aim being to avoid the potential re-submission of data if a user presses refresh and ignores the subsequent warning.
The method suggested has been named PRG (Post / Redirect / Get) and is what we, as Domino developers, have been using — without even knowing it — each time we add a $$Return field to a form or use a Print "Location: " statement in our agents.
Sometimes I'd like to be able to avoid PRG and just return my own HTML after a POST, but I guess the benefits of PRG are obvious.
If you just put HTML into your $$Return field, no square brackets, no PRG is going to happen, or is it?
I think if the double brackets are used in a $$Return or agent Print value. For example, Print "[[/home.nsf]]" as opposed to Print "[/home.nsf]", breaks the PRG. Some even use it as a performance enhancement.
True. But that only works if you're happy to squeeze the whole of site's layout in to one field, which probably wouldn't work anyway. You could of course just return a one-liner to say "form submitted, click here to return" with no layout at all, but that is just bad, bad, bad.
Jay. That's something I've talked about on here before. If you read the limitations part of that page you'll see why I rarely use it.
Hold on a second. Are you actually saying that Domino does something desired in its normal method of operation? Be still my beating heart. I never really thought about it before you posted this, but the refresh issue was not something I thought about on Domino.
This is the model I actively worked towards while building Tornado (the artist formerly known as "puakma"). .NET on the other hand uses this POST business extensively which is a huge PITA (pain in the ...) when users start emailing each other urls - they just don't work or do not refer to the exact portion of the app the first user intended.