Redirection
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Daniel_Nehren
Posted On:   Friday, April 5, 2002 07:59 AM

I have a page that displays a list of Items. I create a link to add an entry to the List that will send it to a new page that has a form to fill. when I press submit from the form I add the element to my bean and formward to the initial page to display the list. everything works well but for one thing, the address in the address box of the browser still point to my addObject action, so if I use the refresh button the application will try to add the entry again, instead of redisplaing my list as it should. What is the correct way to handle this. The example I mentioned is simplicistic and does not reflect all my requirements, but I know the user will try to refresh the browser to see the updated list, once in a while.    More>>

I have a page that displays a list of Items.
I create a link to add an entry to the List that will send it to a new page that has a form to fill. when I press submit from the form I add the element to my bean and formward to the initial page to display the list.


everything works well but for one thing, the address in the address box of the browser still point to my addObject action, so if I use the refresh button the application will try to add the entry again, instead of redisplaing my list as it should.


What is the correct way to handle this. The example I mentioned is simplicistic and does not reflect all my requirements, but I know the user will try to refresh the browser to see the updated list, once in a while.



Please Help!



Daniel

   <<Less

Re: Redirection

Posted By:   Daniel_Nehren  
Posted On:   Friday, April 5, 2002 08:50 AM

I resolved it myself.

The trick is to use the redirect parameter in the forwarding tag in the action.


like this:







About | Sitemap | Contact