You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Alex Shneyderman <a....@gmail.com> on 2008/04/15 10:48:48 UTC

Is there such a thing as flash in S2?

Flash scope is fairly common nowdays (for displaying messages) I
wonder if S2 2.011, has anything similar?

thanks,
Alex.

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


RE: Is there such a thing as flash in S2?

Posted by Brad A Cupit <br...@lsu.edu>.
link to the webwork Flash result Ian mentioned:
http://wiki.opensymphony.com/display/WW/Flash+Result

Brad Cupit
Louisiana State University - UIS

-----Original Message-----
From: Ian Roughley [mailto:ian@fdar.com] 
Sent: Tuesday, April 15, 2008 8:39 AM
To: Struts Users Mailing List
Subject: Re: Is there such a thing as flash in S2?

There is also a flash result type / interceptor in webwork - very easy 
(<2 min) to convert to s2.

/Ian

Don Brown wrote:
> There is the Struts 2 Scope Plugin [1], which does flash scope and a
> lot more.  Also, the message store interceptor, available in core
> out-of-the-box, will persist action and error messages across a
> redirect in a "flash" scope, which is very handy for registering
> validation errors on a POST but having the response redirect the user
> to a GET.
>
> Don
>
> [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
>
> On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
> <a....@gmail.com> wrote:
>   
>> Flash scope is fairly common nowdays (for displaying messages) I
>>  wonder if S2 2.011, has anything similar?
>>
>>  thanks,
>>  Alex.
>>
>>
---------------------------------------------------------------------
>>  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
>
>   



---------------------------------------------------------------------
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


RE: Is there such a thing as flash in S2?

Posted by Guillaume Bilodeau <gb...@yahoo.com>.
Great!  I'm glad it worked fine.  I'll merge your documentation additions as
soon as I have a moment, thanks for providing them.

I like your idea of generating multiple flash map IDs, it seems like a good
solution would make the implementation more flexible.  Feel free to modify
the code and upload it here - again if I have some time I'll try to have a
look at it also.

As for setting a timeout value on the flash map, the idea's interesting but
I think it would only delay the problem.  Sure putting a 60-second delay on
the map would allow it to survive to quick refreshes, but it wouldn't solve
the case when a user returns to this page later using the back button; plus
it would be possible to clog the session with long-lived flash maps if not
used correctly.  On the other hand, maybe it would solve enough cases to
motivate adding this functionality; plus giving a choice to the developer
can be a good thing.  Maybe the Struts2 seniors would like to give their
opinion on this?

To implement this I'd have the result add a timestamp to the map and the
interceptor check for the timestamp's validity instead of starting a timer
though, it would be much lighter.

Cheers,
GB


kenk wrote:
> 
> GB,
> 
> I've finished implementing my use case using your FlashInterceptor and
> FlashResult -- it worked perfectly and I didn't need to change anything in
> your code.  :clap:  
> 
> But it did take me a while to achieve success, mainly owing to my newness
> to Struts 2 and the difficulty I've had following the S2 documentation. 
> So having said that, I have uploaded some revisions to your JavaDocs, in
> hopes that they will help other newbies dealing with the whole flash scope
> issue, perhaps you can add these.
> 
> The main feedback item I have on the code is the hard-coded "__flashMap"
> key on the session -- this limits you to one flash scope at a time.  How
> about having the FlashResult generate a random key value ( i.e.
> __flashMap_xxxxx ), send this as a request parameter, have the
> FlashInterceptor detect this value and use it to access the map.  Poof! 
> No more issue with multiple browser windows open.
> 
> For the refresh issue, have an optional configuration parameter on the
> FlashInterceptor called "flashMapTimeout", defaulting to 60 seconds. 
> Instead of immediately removing the flash map from the session, start a
> java.util.Timer and remove it later.  Poof!  Now the refresh works (until
> the timeout occurs).
> 
> Thanks again for making your code available!
> Ken
> 
>  http://www.nabble.com/file/p17659710/JavaDocAdditions.txt
> JavaDocAdditions.txt 
> 

-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p17670259.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Is there such a thing as flash in S2?

Posted by kenk <ke...@earthlink.net>.
GB,

I've finished implementing my use case using your FlashInterceptor and
FlashResult -- it worked perfectly and I didn't need to change anything in
your code.  :clap:  

But it did take me a while to achieve success, mainly owing to my newness to
Struts 2 and the difficulty I've had following the S2 documentation.  So
having said that, I have uploaded some revisions to your JavaDocs, in hopes
that they will help other newbies dealing with the whole flash scope issue,
perhaps you can add these.

The main feedback item I have on the code is the hard-coded "__flashMap" key
on the session -- this limits you to one flash scope at a time.  How about
having the FlashResult generate a random key value ( i.e. __flashMap_xxxxx
), send this as a request parameter, have the FlashInterceptor detect this
value and use it to access the map.  Poof!  No more issue with multiple
browser windows open.

For the refresh issue, have an optional configuration parameter on the
FlashInterceptor called "flashMapTimeout", defaulting to 60 seconds. 
Instead of immediately removing the flash map from the session, start a
java.util.Timer and remove it later.  Poof!  Now the refresh works (until
the timeout occurs).

Thanks again for making your code available!
Ken

http://www.nabble.com/file/p17659710/JavaDocAdditions.txt
JavaDocAdditions.txt 
-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p17659710.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Is there such a thing as flash in S2?

Posted by kenk <ke...@earthlink.net>.
Thanks GB.  I'll try to respond back to this thread by friday or so. -- K 
:working:

-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p17647498.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Is there such a thing as flash in S2?

Posted by Guillaume Bilodeau <gb...@yahoo.com>.
Hi Ken,

You can find the files and unit tests here:
https://issues.apache.org/struts/browse/WW-2635

Let me know how it works for you, as I couldn't give it extensive testing.

Cheers,
GB


kenk wrote:
> 
> Hi GB,
> 
> Did you ever find a place to post your FlashResult / FlashInterceptor? 
> I'm interested in doing the same thing -- though I understand and agree
> with the disadvantage that Brad spoke of.  Basically, I'm looking to do
> something similar to the 
> http://www.stripesframework.org/display/stripes/State+Management Stripes
> flash scope 
> 
> Thanks in advance,
> Ken
> 
> 
> Guillaume Bilodeau wrote:
>> 
>> Hi guys,
>> 
>> I have just developed a FlashResult / FlashInterceptor pair - turns out
>> ....
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p17629368.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Is there such a thing as flash in S2?

Posted by kenk <ke...@earthlink.net>.
Hi GB,

Did you ever find a place to post your FlashResult / FlashInterceptor?  I'm
interested in doing the same thing -- though I understand and agree with the
disadvantage that Brad spoke of.  Basically, I'm looking to do something
similar to the 
http://www.stripesframework.org/display/stripes/State+Management Stripes
flash scope 

Thanks in advance,
Ken


Guillaume Bilodeau wrote:
> 
> Hi guys,
> 
> I have just developed a FlashResult / FlashInterceptor pair - turns out
> ....
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p17626450.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Is there such a thing as flash in S2?

Posted by Guillaume Bilodeau <gb...@yahoo.com>.
Hi guys,

I have just developed a FlashResult / FlashInterceptor pair - turns out it
wasn't that difficult.  I couldn't give it much testing (for the moment the
only use case in my application that requires flash scope is showing success
messages following a redirect) but for what it's worth it seems to work
fine.  Unit tests are also conclusive.

The FlashResult basically works like the ServletActionRedirectResult except
that instead of converting all extra parameters to strings and adding them
as HTTP parameters in the redirect URL, it creates a HashMap using these
parameter key/value pairs with no conversion and stores it in the user
session.  On the next HTTP request the FlashInterceptor, if properly added
to the interceptor stack, will retrieve this map and copy the map entries to
the target action using the parameter keys.  It should work for all data
types.

To function correctly this approach assumes that bug WW-2170 is fixed.  The
implementation also borrows a lot from the ServletActionRedirectResult and
some refactoring should be done.

Is there a place where I can upload the code so that you guys can check it
out and give me some feedback?  I think this could make a nice addition to
the Struts2 code base.

Cheers,
GB


Brad A Cupit wrote:
> 
>>> This hypothetical flash result could list the properties
>>> that should survive the redirect
>>> <snip/>
>>> I'll investigate writing such a result / interceptor pair.  
> 
> Wouldn't that be the same as the ServletActionRedirectResult, where
> param values can be ognl expressions? (assuming a version of struts 2
> where bug WW-2170 is fixed).
> 
> Now, if this result/interceptor pair instead reads annotations on
> properties in the action, or, if it stores the results in the session
> (and then removed them on the next request) rather than as parameters in
> the url, then it definitely is different from
> ServletActionRedirectResult.
> 
> Having said that, I question using the session, since
> redirect-after-post was designed to help alleviate back and refresh
> button problems. If we store information in the session for the
> redirect, then the first GET will find that information, but subsequent
> GETs (perhaps the result of pressing back or refresh) will not find that
> information, so the GET will have been inconsistent.
> 
> I guess this just pertains to flash scope in general though, and not any
> particular implementation.
> 
> Brad Cupit
> Louisiana State University - UIS
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p16866433.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Is there such a thing as flash in S2?

Posted by KonTiki <pa...@gmail.com>.

Brad A Cupit wrote:
> 
> Having said that, I question using the session, since
> redirect-after-post was designed to help alleviate back and refresh
> button problems. If we store information in the session for the
> redirect, then the first GET will find that information, but subsequent
> GETs (perhaps the result of pressing back or refresh) will not find that
> information, so the GET will have been inconsistent.
> 

Precisely. Using the session to store data across a redirect does indeed
lead to a misbehaving GET.
More importantly, IMHO the need to preserve data this way indicates a design
flaw - Redirect was designed to use GET and there are always (perhaps,
not-so-easy) alternatives to keep it that way.

That said, one occasion when I was forced into using the session this way
was when I wrote a custom solution to redirect across HTTP and HTTPS (like
when a secure resource is accessed via HTTP) for Struts, working very
similar to the SSL plugin.
-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p16935302.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Is there such a thing as flash in S2?

Posted by Brad A Cupit <br...@lsu.edu>.
>> This hypothetical flash result could list the properties
>> that should survive the redirect
>> <snip/>
>> I'll investigate writing such a result / interceptor pair.  

Wouldn't that be the same as the ServletActionRedirectResult, where
param values can be ognl expressions? (assuming a version of struts 2
where bug WW-2170 is fixed).

Now, if this result/interceptor pair instead reads annotations on
properties in the action, or, if it stores the results in the session
(and then removed them on the next request) rather than as parameters in
the url, then it definitely is different from
ServletActionRedirectResult.

Having said that, I question using the session, since
redirect-after-post was designed to help alleviate back and refresh
button problems. If we store information in the session for the
redirect, then the first GET will find that information, but subsequent
GETs (perhaps the result of pressing back or refresh) will not find that
information, so the GET will have been inconsistent.

I guess this just pertains to flash scope in general though, and not any
particular implementation.

Brad Cupit
Louisiana State University - UIS

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


RE: Is there such a thing as flash in S2?

Posted by Guillaume Bilodeau <gb...@yahoo.com>.
I'm aware of the chain result but I'd prefer to stick to the redirect result.

This hypothetical flash result could list the properties that should survive
the redirect, so I think we would avoid the problem with the CGLIB proxy.

I'll investigate writing such a result / interceptor pair.  I suppose the
chaining interceptor would be a good reference?

Cheers,
GB


Brad A Cupit wrote:
> 
>>> What would be great is if an interceptor would inject all
>>> properties that are shared by the previous and the current
>>> action (by name? by type?) in the current action, in a similar
>>> fashion to HTTP parameter injection.
> 
> If you use an ActionChainResult it will automatically do this, but
> action chaining is not recommended in favor or redirect-after-post
> (a.k.a. POST-redirect-GET).
> 
> If such a feature does exist (or were to exist) and copy the properties
> from Action1 to Action2 (with a redirect in between) it may actually
> cause problems similar to Action chaining: like when your Action is
> managed by Spring and Spring creates a CGLIB proxy and certain
> properties that are specific to CGLIB are copied from Action1 to Action2
> thereby messing up the proxy.  :-(
> 
> Brad Cupit
> Louisiana State University - UIS
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p16754097.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


RE: Is there such a thing as flash in S2?

Posted by Brad A Cupit <br...@lsu.edu>.
>> What would be great is if an interceptor would inject all
>> properties that are shared by the previous and the current
>> action (by name? by type?) in the current action, in a similar
>> fashion to HTTP parameter injection.

If you use an ActionChainResult it will automatically do this, but
action chaining is not recommended in favor or redirect-after-post
(a.k.a. POST-redirect-GET).

If such a feature does exist (or were to exist) and copy the properties
from Action1 to Action2 (with a redirect in between) it may actually
cause problems similar to Action chaining: like when your Action is
managed by Spring and Spring creates a CGLIB proxy and certain
properties that are specific to CGLIB are copied from Action1 to Action2
thereby messing up the proxy.  :-(

Brad Cupit
Louisiana State University - UIS


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


Re: Is there such a thing as flash in S2?

Posted by Ian Roughley <ia...@fdar.com>.
Your right.  The flash interceptor is more for the benefit of the next 
JSP page (i.e. redirect after post pattern) and not for accessing data 
in the current action.  For this scenario you can use the chaining 
interceptor/result type - match setters on the current action with 
getters from the previously executed action.

/Ian

Guillaume Bilodeau wrote:
> Hi Ian,
>
> First let me congratulate you on your Struts2 book, I honestly think it's
> one of the best technical books I've read in a while: it's thorough,
> practical and tackles every day issues.  Kudos to you!
>
> About that WebWork flash interceptor, it seems to me that it's not that
> useful.  AFAICT it simply puts the previously executed action on the value
> stack given to the currently executed action.  This works great if all you
> need is access properties in the final JSP, but what if the current action
> needs to access these properties?  If I understand correctly, to do this the
> action must browse through the value stack explicitly or do an OGNL lookup
> on the value stack.  To me this seems impractical and feels very different
> from the overall Struts2 paradigm.
>
> The Scope plugin also feels like too much a departure from the Struts2
> paradigm.
>
> What would be great is if an interceptor would inject all properties that
> are shared by the previous and the current action (by name? by type?) in the
> current action, in a similar fashion to HTTP parameter injection.
>
> Is there an interceptor that does this or is this something that should be
> developed?
>
> Cheers,
> GB
>
>
>
> Ian Roughley wrote:
>   
>> There is also a flash result type / interceptor in webwork - very easy 
>> (<2 min) to convert to s2.
>>
>> /Ian
>>
>> Don Brown wrote:
>>     
>>> There is the Struts 2 Scope Plugin [1], which does flash scope and a
>>> lot more.  Also, the message store interceptor, available in core
>>> out-of-the-box, will persist action and error messages across a
>>> redirect in a "flash" scope, which is very handy for registering
>>> validation errors on a POST but having the response redirect the user
>>> to a GET.
>>>
>>> Don
>>>
>>> [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
>>>
>>> On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
>>> <a....@gmail.com> wrote:
>>>   
>>>       
>>>> Flash scope is fairly common nowdays (for displaying messages) I
>>>>  wonder if S2 2.011, has anything similar?
>>>>
>>>>  thanks,
>>>>  Alex.
>>>>
>>>>  ---------------------------------------------------------------------
>>>>  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
>>>
>>>   
>>>       
>>
>> ---------------------------------------------------------------------
>> 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


Re: Is there such a thing as flash in S2?

Posted by Guillaume Bilodeau <gb...@yahoo.com>.
Hi Ian,

First let me congratulate you on your Struts2 book, I honestly think it's
one of the best technical books I've read in a while: it's thorough,
practical and tackles every day issues.  Kudos to you!

About that WebWork flash interceptor, it seems to me that it's not that
useful.  AFAICT it simply puts the previously executed action on the value
stack given to the currently executed action.  This works great if all you
need is access properties in the final JSP, but what if the current action
needs to access these properties?  If I understand correctly, to do this the
action must browse through the value stack explicitly or do an OGNL lookup
on the value stack.  To me this seems impractical and feels very different
from the overall Struts2 paradigm.

The Scope plugin also feels like too much a departure from the Struts2
paradigm.

What would be great is if an interceptor would inject all properties that
are shared by the previous and the current action (by name? by type?) in the
current action, in a similar fashion to HTTP parameter injection.

Is there an interceptor that does this or is this something that should be
developed?

Cheers,
GB



Ian Roughley wrote:
> 
> There is also a flash result type / interceptor in webwork - very easy 
> (<2 min) to convert to s2.
> 
> /Ian
> 
> Don Brown wrote:
>> There is the Struts 2 Scope Plugin [1], which does flash scope and a
>> lot more.  Also, the message store interceptor, available in core
>> out-of-the-box, will persist action and error messages across a
>> redirect in a "flash" scope, which is very handy for registering
>> validation errors on a POST but having the response redirect the user
>> to a GET.
>>
>> Don
>>
>> [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
>>
>> On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
>> <a....@gmail.com> wrote:
>>   
>>> Flash scope is fairly common nowdays (for displaying messages) I
>>>  wonder if S2 2.011, has anything similar?
>>>
>>>  thanks,
>>>  Alex.
>>>
>>>  ---------------------------------------------------------------------
>>>  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
>>
>>   
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-there-such-a-thing-as-flash-in-S2--tp16697840p16744246.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Is there such a thing as flash in S2?

Posted by Ian Roughley <ia...@fdar.com>.
There is also a flash result type / interceptor in webwork - very easy 
(<2 min) to convert to s2.

/Ian

Don Brown wrote:
> There is the Struts 2 Scope Plugin [1], which does flash scope and a
> lot more.  Also, the message store interceptor, available in core
> out-of-the-box, will persist action and error messages across a
> redirect in a "flash" scope, which is very handy for registering
> validation errors on a POST but having the response redirect the user
> to a GET.
>
> Don
>
> [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
>
> On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
> <a....@gmail.com> wrote:
>   
>> Flash scope is fairly common nowdays (for displaying messages) I
>>  wonder if S2 2.011, has anything similar?
>>
>>  thanks,
>>  Alex.
>>
>>  ---------------------------------------------------------------------
>>  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
>
>   



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


Re: Is there such a thing as flash in S2?

Posted by Don Brown <do...@gmail.com>.
Oh, didn't see the 2.0.11.1 requirement...not sure if the message
store interceptor code is in that branch, but the scope plugin should
work just fine.

Don

On Tue, Apr 15, 2008 at 7:19 PM, Don Brown <do...@gmail.com> wrote:
> There is the Struts 2 Scope Plugin [1], which does flash scope and a
>  lot more.  Also, the message store interceptor, available in core
>  out-of-the-box, will persist action and error messages across a
>  redirect in a "flash" scope, which is very handy for registering
>  validation errors on a POST but having the response redirect the user
>  to a GET.
>
>  Don
>
>  [1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html
>
>
>
>  On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
>  <a....@gmail.com> wrote:
>  > Flash scope is fairly common nowdays (for displaying messages) I
>  >  wonder if S2 2.011, has anything similar?
>  >
>  >  thanks,
>  >  Alex.
>  >
>  >  ---------------------------------------------------------------------
>  >  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


Re: Is there such a thing as flash in S2?

Posted by Don Brown <do...@gmail.com>.
There is the Struts 2 Scope Plugin [1], which does flash scope and a
lot more.  Also, the message store interceptor, available in core
out-of-the-box, will persist action and error messages across a
redirect in a "flash" scope, which is very handy for registering
validation errors on a POST but having the response redirect the user
to a GET.

Don

[1] http://cwiki.apache.org/S2PLUGINS/scope-plugin.html

On Tue, Apr 15, 2008 at 6:48 PM, Alex Shneyderman
<a....@gmail.com> wrote:
> Flash scope is fairly common nowdays (for displaying messages) I
>  wonder if S2 2.011, has anything similar?
>
>  thanks,
>  Alex.
>
>  ---------------------------------------------------------------------
>  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