| Author |
what does redirect attribute of action forward do when set to false
|
aryan malhotra
Greenhorn
Joined: Dec 05, 2006
Posts: 11
|
|
|
inside action mappings there are multiple actions ,now for every action thrs a forward..thus action is the parent element and forward is the child element ....now what will happen if i set the redirect attribute of forward element to false ......
|
 |
Brent Sterling
Ranch Hand
Joined: Feb 08, 2006
Posts: 948
|
|
Do you understand what happens when you set this value to true? Basically, setting this value to false or leaving off this attribute (the default is false) will simply forward to the given resource. The biggest difference is that if this value is true, then the browser will initiate another request which will create a brand new request object causing any values set on the request to be lost. - Brent
|
 |
aryan malhotra
Greenhorn
Joined: Dec 05, 2006
Posts: 11
|
|
|
You mean to say that the redirect attribute is similar to senredirect .Can you please tell me any scenario when i can set this attribute true.
|
 |
Brent Sterling
Ranch Hand
Joined: Feb 08, 2006
Posts: 948
|
|
Almost any time that I am forwarding to another action I set redirect to true. For example...the user clicks the Save button on the User page and the action SaveUser.do is called. When that action completes it forwards (with redirect = true) to DisplayUserList.do which shows an updated list of users. One issue with not setting redirect = true is that the user would be looking at the user list page but the URL in the browser is still SaveUser.do. If the user clicks the refresh link it will try to call SaveUser.do again which is likely to cause errors. - Brent
|
 |
Pradeep
Ranch Hand
Joined: Sep 19, 2006
Posts: 49
|
|
|
setting it false means you can not get desired page after refreshing
|
 |
 |
|
|
subject: what does redirect attribute of action forward do when set to false
|
|
|