struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Pratt <>
Subject Re: PRG pattern question
Date Mon, 31 May 2010 19:30:30 GMT
If you want to implement the PRG pattern, I only see two possibilities.
Either you put the information in the session to preserve it from the P to
the G or you put hidden parameters in a form on the page.  It's a lot more
secure keeping the data on the server side.  But I could be missing an

On May 31, 2010 3:35 AM, "szerintedmi" <> wrote:

Thanks all for the help...

The store interceptor definitely is part of the solution.  (If you lost and
nothing else helps read the documentation :) )

I still need  to sort out how to "redirect" the params. I'm thinking about
to make an interceptor in similar way how the store interceptor works:

1. the interceptor stores all params (except files?) in the http session

2. the next request cleans them up from the session and retrieves them if
interceptor in RETRIEVE mode or if in AUTOMATIC mode it retrieves only if
the request is a response to a redirect action.

If there is no next request It would disappear when the http session

It would make sense to add this interceptor in STORE mode to all actions
where we post data. The response in case of a form error would be
redirectAction to the orignal action (which originally populated the form)
where the interceptor could RETRIEVE params.

This new interceptor combined with the store interceptor might solve this
PRG issue and let me make a "perfect" PRG workflow with nicely working
browser back button.

However I agree with Greg that's not such a good idea to store staff in http

Need think over what this causes if the result is success and the next
action is a form too (with this interceptor added). The next action
RETRIEVEs params from the previous post...

What is your opinion? Would this interceptor make sense?



---------- Forwarded message ----------
From: Alex Rodriguez Lopez <>
To: use...

> Hi Everybody,
>> I would like to ask some advice implementing PRG pattern with struts2
>> (usi...

Em 26-05-2010 16:57, Chris Pratt escreveu:

If you search the forum, someone posted an Interceptor (...

On Wed, May 26, 2010 at 5:45 AM, szerintedmi<> wrote:

Hi Everybody,

I would like ...

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message