On the same topic of flash scopes for the following code...:

action1:
FlashScope scope = FlashScope.getCurrent(getContext().getRequest(), true);
scope.put("test", "testing");
return new RedirectResolution(MyActionBean.class);

MyActionBean's default handler:
System.out.println(getContext().getRequest().getAttribute("test"));
<- prints null

However, if in action1, I did:
return new RedirectResolution(MyActionBean.class).flash(this);

Then the attribute comes through.

I thought I read the doc that the RedirectResolution would append
__fsk parameter if flash scope was present regardless of whether
flash() is called?

Thanks,

On Mon, Nov 17, 2008 at 1:30 PM, Oscar Westra van Holthe - Kind
<[EMAIL PROTECTED]> wrote:
> On 17-11-2008 at 10:00, Asleson, Ryan wrote:
>> I have a quick question about Flash scope.  Let's say I have an action
>> bean that puts a User object in Flash scope under the name "user" and
>> then redirects to another action bean.  When the second action bean is
>> invoked, the User object is available on the request object under the
>> key "user".
>>
>> My question:  If the second action bean has a setter method named
>> setUser, will Stripes bind that flashed object to the action bean?  Or
>> does it need to be accessed through the request object?
>
> You have a user object in the flash scope (and later in the request scope
> for the the second action). This object will be a request attribute, and not
> a request parameter. Thus, it will not be considered for binding.
>
> I suggest you take a look at the page descriding state management on the
> website. It described a way to abstract away from request and session
> attributeѕ, by retrieving them from the request/session in your action bean
> context.
>
>
> Oscar
>
> --
>   ,-_   No trees were killed in the creation of this message. However,
>  /() )  many electrons were terribly inconvenienced.
>  (__ (    -- Anonymous
> =/  ()
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to