logo

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.

Comments

  1. If you just put HTML into your $$Return field, no square brackets, no PRG is going to happen, or is it?

    • avatar
    • jay
    • Thu 11 Oct 2007 04:46 AM

    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.

    • avatar
    • Jake Howlett
    • Thu 11 Oct 2007 04:48 AM

    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.

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

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

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment:


About This Page

Written by Jake Howlett on Thu 11 Oct 2007

Share This Page

# ( ) '

Comments

The most recent comments added:

Skip to the comments or add your own.

You can subscribe to an individual RSS feed of comments on this entry.

Let's Get Social


About This Website

CodeStore is all about web development. Concentrating on Lotus Domino, ASP.NET, Flex, SharePoint and all things internet.

Your host is Jake Howlett who runs his own web development company called Rockall Design and is always on the lookout for new and interesting work to do.

You can find me on Twitter and on Linked In.

Read more about this site »

More Content