Re: WebMacro-user, Double Submit problem
Nikolaos Papadakis <[email protected]> Fri, 25 Nov 2005 22:27:11 +0200
| Newsgroups | gmane.comp.java.webmacro.user |
|---|---|
| Message-ID | <[email protected]> |
Hi Nick, all, First of all thx for your reply. I have managed to find another work around for this problem. The main idea is to keep a counter in the session. This counter is passed to the html page, through the context, and is incremented by one when the user presses the 'submit' button. When the request is received the value of the counter is compared to the value stored in the session. If the two values differ by one, then it is a new request. Else it means that the request came from a 'refresh' without the user pressing the submit button. This solution seems to work but it is a little complicated, so I would still be interested in a simpler, more straightforward solution, as the one you suggested. Unfortunatelly, I am a newbie in webmacro, so could you please indicate in more detail how exactly a redirect is implemented in webmacro? A code snippet would be very appreciated. Thx in advance, Nikolaos Nick Sanderson wrote: Hi Nikolaos The simple solution is to use a post to submit the data but to redirect to the display page. That way the post is not repeated as the page has been reached as a result of a GET. Regards Nick [email protected] 11/24/05 12:09 PM >>> Nikolaos Papadakis wrote: Hi all, I am using webmacro to develop a (small) web-based application. I am facing a problem in my application. The problem occurs when the user re-submits a request, using one of the following methods: 1. reloading result page using Refresh/Reload browser button, 2. clicking Back and then Forward browser buttons, 3. returning back to HTML FORM after submission and clicking Submit button on the form again. Browsers usually, display a warning message when the same POST request is about to be resent to the server. But the message is too technical and obscure for an average user. Also, some browsers do not ask for confirmation at all. Is it possible to get rid of this kind of inconvenience? Is there any hint you can give me for this phenomenon? Can webmacro handle this? Any source code would be appreciated. Hi, WebMacro is not a web framework, it is just a view layer (renderer). As such WebMacro does not provide any functionality relating to the double-post problem. Cheers ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Webmacro-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/webmacro-user This mail has been checked at MSXI for all known virus'. You open this at your own risk. Please make sure all replies are virus free. Also, we do not accept or send attachments of the type exe, vbs, scr or bat due to the increased virus risk they contain. These types of attachments will be stripped from the message. MSXI ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Webmacro-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/webmacro-user ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click