struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brad A Cupit" <b...@lsu.edu>
Subject RE: interesting proxy + action chain issue
Date Thu, 10 Apr 2008 14:03:13 GMT
The only problem with the scope plugin is that it will use the session,
which may break the whole notion of POST-redirect-GET: if the data in
the session is removed or replaced by later requests, then pressing the
back or refresh buttons on the initial page with errors will not yield
the same response.

I think it would be cool if the errors were url parameters as part of
the redirect, but there's currently no easy way to do this. Could a
custom interceptor realize that the result is a redirect and turn the
validation errors into url parameters? Or would this need to be a custom
result class (perhaps extending ServletRedirectResult or
ServletActionRedirectResult)?

Brad Cupit
Louisiana State University - UIS

-----Original Message-----
From: Jeromy Evans [mailto:jeromy.evans@blueskyminds.com.au] 
Sent: Tuesday, April 08, 2008 6:24 PM
To: Struts Users Mailing List
Subject: Re: interesting proxy + action chain issue

Ian Meikle wrote:
> HI,
>
> I have been following this post with interest since I used the PRG
pattern 
> in previous projects.
> We are using struts 2 in are current project and I like the
errorMessages 
> behaviour that is part of the Action.
>
> Is it possible to persist these over the PRG cycle ?
> By default I assume they would be lost when we get to the GET stage
since 
> they are request scope and the GET is a seperate request than the POST

> that caused  the error.
>
>   

Hi Ian,
This is an issue that Struts2 needs to handle better.  It can be done 
but its not as straight-forward as it could be.

The scope interceptor [1] provides this feature. It allows you to 
specify which properties should be bound to session or application scope

and injected into the action.
The scoped modeldriven interceptor is for modeldriven actions [2].  Both

are included in the default stack.

The scope plugin allows annotations to specify which properties persist 
over a cycle.  It's not bundled with struts but I have heard good 
comments about it [4].

[1] http://cwiki.apache.org/WW/scope-interceptor.html
[2] http://cwiki.apache.org/WW/scoped-model-driven-interceptor.html
[3] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
[4] http://article.gmane.org/gmane.comp.jakarta.struts.devel/65052

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message