Showing posts with label forward. Show all posts
Showing posts with label forward. Show all posts
0

Preventing Form Resubmission (due refreshing)

To prevent form resubmission due to page refresh we can use HTTP redirect

To use HTTP redirect feature, the forward is set as follows:



However there is one catch in this method, the actual jsp name is shown.

Therefore we can change the forward action as following:

<forward redirect="true" path="/gotoSuccess.do" name="success">

where gotoSuccess.do is another action mapping using forward action as follows:
<action path="/gotoSuccess" validate="false" parameter="/success.jsp" type="org.apache.actions.ForwardAction">

|
0

Struts Forward redirect=true

excerpted from : Struts : The complete Reference

The forward tag looks up a forward from the Struts configuration file and redirects to it. Based on the way that the forward is defined in the configuration file, this tag will either forward to the URL specified by the forward or perform a redirect to it. If the forward has its redirect attribute set to “true”, as shown in the following example, this tag will perform a redirect:

A redirect sends a response to the user’s browser instructing it to load another page. A forward, on the other hand, simply “forwards” control (on the server side) to another URL without having the browser make another request.

Note that only URLs residing on the same server can be forwarded to, whereas any URL can be redirected to.

|

Copyright © 2009 So That I Can Remember All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive.