Re: Errors/Messages on Redirect

2003-04-04 Thread Cody Sherr
Brian,

I had the same problem. I did the following:

1) save the errors in the session instead of the request

2) wrote a method that takes the messages from the session, and puts it
into the request. I call that after my redirect is done.

I thought about having the .jsp pull it out of the session and display
it, but I was concerned about that being fragile if the user's control
flow somehow didn't lead to the message display page. So instead, I do
it in my controller (we're using tiles, too, so I have more than 1
action being called for every page).

I'd be interested in hearing what approach you took to solving this
problem.

cheers,

--
Cody Sherr

Software Engineer
Covalent Technologies, Inc.


On Fri, 2003-03-28 at 10:47, Brian K Bonner wrote:
 Has anyone else run into this scenario before?  I've searched the archives 
 and couldn't find much on the topic of errors and redirect.
 
 During an action, I want may encounter an error condition and I want to 
 REDIRECT the user back to the page where they came from and pass along the 
 error.  I need to do a redirect to get the URL of the browser to reflect 
 the page where they came from (in case they bookmark the link).  If I 
 don't do a redirect then the page being displayed reflects the action they 
 were trying to perform and they are out of synch.
 
 The problem with this is that I can't pass the ActionErrors / 
 ActionMessages on the request as they are lost with the redirect.
 
 One option I've thought of is to put the data on the session and then 
 strip it off in the jsp--each request in a session would need to put data 
 in via a unique key that's not in the session (in the event of 
 simultaneous requests).
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Errors/Messages on Redirect

2003-03-28 Thread Brian K Bonner
Has anyone else run into this scenario before?  I've searched the archives 
and couldn't find much on the topic of errors and redirect.

During an action, I want may encounter an error condition and I want to 
REDIRECT the user back to the page where they came from and pass along the 
error.  I need to do a redirect to get the URL of the browser to reflect 
the page where they came from (in case they bookmark the link).  If I 
don't do a redirect then the page being displayed reflects the action they 
were trying to perform and they are out of synch.

The problem with this is that I can't pass the ActionErrors / 
ActionMessages on the request as they are lost with the redirect.

One option I've thought of is to put the data on the session and then 
strip it off in the jsp--each request in a session would need to put data 
in via a unique key that's not in the session (in the event of 
simultaneous requests).

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]