aspose file tools*
The moose likes Struts and the fly likes Problem when refresh the page in WebLogic 8.1 Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Problem when refresh the page in WebLogic 8.1 Struts" Watch "Problem when refresh the page in WebLogic 8.1 Struts" New topic
Author

Problem when refresh the page in WebLogic 8.1 Struts

Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi All,
How can i do in jsp(actually this is on html) to be submitted only when i click the submit button?Right now, i already submitted the form and then press the refresh button of the browser it is submitted again. I am using WebLogic8.1 workshop and Struts Framework. How can i prevent this one?
Thanks
Bikash
Corneil du Plessis
Greenhorn

Joined: Feb 12, 2004
Posts: 13
When you press the refresh button it will refresh the current request. Your current page is a response from a 'post' of the previous page.
If you want the customer to be able to refresh the screen you must use redirect=true in you forward mapping in Struts. The response is then a result of a separate get operation. It also means that the form will have to be in session scope and not request scope.
If you want to prevent the customer from refreshing and thus re-submitting you should put a property in your form that indicates the state so the your validate can produce an error.
You must remember that if the form is submitted the Struts controller will assign the request parameters to your form and then call validate, it may overwrite something you want preserved.
Bikash Paul
Ranch Hand

Joined: Dec 04, 2001
Posts: 342
Hi,
Actually I have tried with below code in .jpf file.


I am using weblogic8.1 workshop. I am not giving any mappings. That mapping will do automatically in workshop itself.

If any other solutions pls guide me.
Thanks
Bikash
[ March 02, 2004: Message edited by: Bikash Paul ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem when refresh the page in WebLogic 8.1 Struts