redirect event, persistArgs, and refreshing the page

161 views
Skip to first unread message

Doug

unread,
Dec 2, 2009, 4:28:22 PM12/2/09
to Mach-II for CFML
Hello Mach-II Team,

We have an event that receives a form post, processes data, and goes
to a results page. We're using <redirect event="results"
persist="true" /> (Mach-II 1.8 RC1), and the redirect works as it
should. However, if the user refreshes the results page, the objects
we've stored in the event args are not retrieved again, causing the
results page to fail.

I can see that the persisted objects are still in the session, but
they are not retrieved in the normal handleRequest() process when
RequestRedirectPersist.read() is called. It appears that the persisted
args are stored in a cache and then removed on the first redirect.

So, what is the recommended way to handle the case where you want to
redirect to a results page, allowing the user refresh the page and
still see the results that are dependent on persisted args?

Thanks,

Doug
http://www.daveramsey.com

Doug

unread,
Dec 2, 2009, 4:37:58 PM12/2/09
to Mach-II for CFML
We just found this discussion on this subject (we had searched before
but didn't find this until after I posted):

http://groups.google.com/group/mach-ii-for-coldfusion/browse_thread/thread/a4d1fd9b7dce1e9a/3dd93565cf83763f?#3dd93565cf83763f

Any more to add to this since 2007?

Thanks,

Doug

Peter J. Farrell

unread,
Dec 2, 2009, 4:45:42 PM12/2/09
to mach-ii-for...@googlegroups.com
http://greatbiztoolsllc.trac.cvsdude.com/mach-ii/wiki/RedirectPersistPageReloadError

Redirect persist is a like Spring "flash" scope. It solves the problem
of doing post-redirect-get (PRG) routines. That's the background on
that in the FAQ above.

Handling what you want to accomplish depends. If what you are trying to
do is part of a multi-step process, pulling from the session is
easiest. If you have saved it to the DB, just pull back from the DB.

Best,
.Peter

Doug said the following on 12/02/2009 03:28 PM:
Reply all
Reply to author
Forward
0 new messages