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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to