File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes what does redirect attribute of action forward do when set to false Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "what does redirect attribute of action forward do when set to false " Watch "what does redirect attribute of action forward do when set to false " New topic
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: what does redirect attribute of action forward do when set to false