Jeromy Evans wrote:
Brad A Cupit wrote:
...

POSTS should each have their own Action (which may write the data to the
DB). This Action should only process the POST. Afterwards, it forwards
(chains) to another Action, which sits in front of the view. If the view
needs data from the DB, it goes in the Action for that view (not the
POST-handling Action). If the view doesn't need data, then the Action is
dumb and just forwards to the view.


The reason the post-redirect-get pattern is typically preferred over your approach is for handling of the browser's back button. By returning a redirect the browser is prevented from reposting data/showing a warning if the user presses back. Your approach is clearly more efficient as it removes a request-response cycle, but unfortunately the repost issue usually supersedes that.




I thought I'd add that a way to overcome this in modern browsers is to perform all posts via an asynchronous request. The POST returns a pass/fail response and the client then determines which action to take (eg. update the DOM, render the post response, perform a GET) etc.

Prasad, Taneja & Todankar's paper "Life Above the Service Tier" [1] contains a good description of the problem.

[1] http://wisdomofganesh.blogspot.com/2007/10/life-above-service-tier.html




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to