You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Travis Reeder <tr...@gmail.com> on 2006/03/27 20:41:23 UTC
Messages when redirecting
Anyone opposed to doing something like this for messages after a redirect:
1. Save messages in session
2. Use messages in session and remove from session
Rather than just on the request? This way, they can be shown after a
redirect. At least in the tomahawk messages tag anyways.
Travis
Re: Messages when redirecting
Posted by Travis Reeder <tr...@gmail.com>.
It could be optional too, maybe a setting in web.xml like the other
extensions settings.
The thread local won't work, because a redirect is not in the same thread
(well it could be, but that would be leaving things to luck). ;)
Travis
On 3/27/06, Mike Kienenberger <mk...@gmail.com> wrote:
>
> On 3/27/06, Travis Reeder <tr...@gmail.com> wrote:
> > Anyone opposed to doing something like this for messages after a
> redirect:
> >
> > 1. Save messages in session
> > 2. Use messages in session and remove from session
> >
> > Rather than just on the request? This way, they can be shown after a
> > redirect. At least in the tomahawk messages tag anyways.
>
> I don't think it's a good idea. The end-developer may not want a
> session created. Is it reasonable to assume that a thread-local
> variable could be used instead since the same thread will continue
> processing the request? I'm not really an expert on servlets or
> thread-local variables, so consider this more of a -0 than a -1.
>
> And if we do handle messages like this, I'd like to see us also handle
> saveState behavior like this as well. I suppose we might need a
> "preserveAcrossRedirect" attribute set on saveState to insure we
> support the existing behavior in case someone is counting on redirects
> to fail to saveState.
>
Re: Messages when redirecting
Posted by Travis Reeder <tr...@gmail.com>.
Just use the default and put it on the request. You'll lose the message on
a redirect, but still have it on forwards.
Travis
On 3/28/06, Mike Kienenberger <mk...@gmail.com> wrote:
>
> On 3/27/06, Travis Reeder <tr...@gmail.com> wrote:
> > Or you check to make sure a session already exists before putting the
> > messages on it.
>
> Yes, but what alternative is there if the session doesn't exist except
> to create it?
>
Re: Messages when redirecting
Posted by Mike Kienenberger <mk...@gmail.com>.
On 3/27/06, Travis Reeder <tr...@gmail.com> wrote:
> Or you check to make sure a session already exists before putting the
> messages on it.
Yes, but what alternative is there if the session doesn't exist except
to create it?
Re: Messages when redirecting
Posted by Travis Reeder <tr...@gmail.com>.
Or you check to make sure a session already exists before putting the
messages on it.
Travis
On 3/27/06, Mike Kienenberger <mk...@gmail.com> wrote:
>
> On 3/27/06, Travis Reeder <tr...@gmail.com> wrote:
> > Anyone opposed to doing something like this for messages after a
> redirect:
> >
> > 1. Save messages in session
> > 2. Use messages in session and remove from session
> >
> > Rather than just on the request? This way, they can be shown after a
> > redirect. At least in the tomahawk messages tag anyways.
>
> I don't think it's a good idea. The end-developer may not want a
> session created. Is it reasonable to assume that a thread-local
> variable could be used instead since the same thread will continue
> processing the request? I'm not really an expert on servlets or
> thread-local variables, so consider this more of a -0 than a -1.
>
> And if we do handle messages like this, I'd like to see us also handle
> saveState behavior like this as well. I suppose we might need a
> "preserveAcrossRedirect" attribute set on saveState to insure we
> support the existing behavior in case someone is counting on redirects
> to fail to saveState.
>
Re: Messages when redirecting
Posted by Mike Kienenberger <mk...@gmail.com>.
On 3/27/06, Travis Reeder <tr...@gmail.com> wrote:
> Anyone opposed to doing something like this for messages after a redirect:
>
> 1. Save messages in session
> 2. Use messages in session and remove from session
>
> Rather than just on the request? This way, they can be shown after a
> redirect. At least in the tomahawk messages tag anyways.
I don't think it's a good idea. The end-developer may not want a
session created. Is it reasonable to assume that a thread-local
variable could be used instead since the same thread will continue
processing the request? I'm not really an expert on servlets or
thread-local variables, so consider this more of a -0 than a -1.
And if we do handle messages like this, I'd like to see us also handle
saveState behavior like this as well. I suppose we might need a
"preserveAcrossRedirect" attribute set on saveState to insure we
support the existing behavior in case someone is counting on redirects
to fail to saveState.