forward vs redirect ?

2003-12-01 Thread Antony Paul
Hi, I would like to receive comments on when to use forward and redirect in action mapping. Do people use forward only. All the articles and examples I saw uses forward. Antony Paul. - To unsubscribe, e-mail: [EMAIL

Re: forward vs redirect ?

2003-12-01 Thread Claire Wall
[EMAIL PROTECTED] Sent: Monday, December 01, 2003 1:28 PM Subject: forward vs redirect ? Hi, I would like to receive comments on when to use forward and redirect in action mapping. Do people use forward only. All the articles and examples I saw uses forward. Antony Paul

Re: forward vs redirect ?

2003-12-01 Thread Antony Paul
:29 PM Subject: Re: forward vs redirect ? Hi Antony, As a rule i always use just forward unless there is a specific need to redirect to the page you're forwarding to. For example, say i had an action which saved some details from a form to a database. if the page is not redirected

Re: forward vs redirect ?

2003-12-01 Thread Hubert Rabago
Anthony, I use redirect to separate actions which do work and actions which display information. Let's say I have 2 pages/Action objects: DisplayItem, ProcessBid. The user sees an item he likes (say displayItem.do?id=123) and enters a bid. The bid will get submitted to processBid.do. Once

Re: forward vs redirect ?

2003-12-01 Thread Caroline Lauferon
For example, say i had an action which saved some details from a form to a database. if the page is not redirected then if the user were to refresh the page, the action would be called again and the data saved again. This obviously i would not want the user to do so in this case i redirect the

Re: forward vs redirect ?

2003-12-01 Thread Claire Wall
: Re: forward vs redirect ? For example, say i had an action which saved some details from a form to a database. if the page is not redirected then if the user were to refresh the page, the action would be called again and the data saved again. This obviously i would not want the user to do

Re: forward vs redirect ?

2003-12-01 Thread Hubert Rabago
Hi Caroline, I sent you a struts war file ready to deploy. It includes all source files. Call up the displayItem.do, enter a bid amount, submit the form, then refresh on the resulting page. Both action objects do a System.out.println when they're called. When you refresh the page after

Re: forward vs redirect ?

2003-12-01 Thread Caroline Lauferon
? is it the action or the jsp page? claire - Original Message - From: Caroline Lauferon [EMAIL PROTECTED] To: Struts Users Mailing List [EMAIL PROTECTED] Sent: Monday, December 01, 2003 4:04 PM Subject: Re: forward vs redirect ? For example, say i had an action which saved some

Re: forward vs redirect ?

2003-12-01 Thread Caroline Lauferon
Thank you very much Hubert! and Thank you Claire! it indeed works the way you describe it. I suppose redirect=true works only with /sthg.do or sthg.jsp, and not with a tile definition, isn't it? So, to solve my problem, I should use a /mytiledefinition.do (being a forward action), like this :

Re: forward vs redirect ?

2003-12-01 Thread Juan Alvarado
I know every situation is different depending on the environment you are in. However, the use of redirect to prevent double form submissions is not an appropriate solution to that problem. I prefer to use the built in mechanism in struts (transactional tokens) to solve this problem for me. This

Re: forward vs redirect ?

2003-12-01 Thread Hubert Rabago
If you define double submissions as the user clicking submit twice, then no, redirect doesn't save you from that. You should use transactional tokens (assuming your app design/specs allow you to). If your mappings are like this: action path=/displayItem type=MyDisplayAction forward