Brad A Cupit wrote:
ServletActionRedirectResult worked when I used it instead of the
ActionChainResult. This performs an extra round trip back to the
browser, which isn't terrible unless I want to pass data from one Action
to another, and herein lies some concern.
...

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.


Seems like a nice design, but Action chaining isn't recommended, and
isn't working with CGLIB proxies  :-(


The main argument for discouraging action chaining is simply to reduce coupling between actions. I didn't realise Ognl was performing a copy. I thought the next action was simply pushed onto the stack above the previous action allowing you to access the properties of the previous action. I guess I'm wrong.
You may have stumbled upon another reason to discourage use of chaining.




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

Reply via email to