|
From: Nikolaos P. <nk...@cc...> - 2005-11-28 17:49:55
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you Nick, <br>
I will try it.<br>
<br>
Best Regards,<br>
Nikolaos<br>
<br>
Nick Sanderson wrote:
<blockquote cite="mid...@ms..." type="cite">
<pre wrap="">Hi Nikolaos
There's nothing wrong with the 'token' solution that you are using . It
is often called a NONCE - number once. (In the Uk this is fairly amusing
as nonce is slang for a sex offender!) I use it a lot to prevent double
submits, but if all you want to do is let the user use the refresh
button without resubmitting the data the POST followed by GET is
easier.
This can be achieved in the servlet code by using a response redirect.
eg
webContext.getResponse().sendRedirect("<path required>");
return null; //needed to tell webmacro not to produce output for this
request.
Unlike the request despatcher the response send redirect actually sends
a esponse to the client. This changes the page headers and causes a get
request to the required resource. Thus providing an i'n between' state
so that refresh no longer reposts the data.
Regards
Nick
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap=""><a class="moz-txt-link-abbreviated" href="mailto:nk...@cc...">nk...@cc...</a> 11/25/05 08:27PM >>>
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->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 NikolaosThe simple solution is to use a post
to submit the data but to redirectto the display page. That way the post
is not repeated as the page hasbeen reached as a result of a
GET.RegardsNick <a class="moz-txt-link-abbreviated" href="mailto:ma...@an...">ma...@an...</a> 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
logfilesfor problems? Stop! Download the new AJAX search engine that
makessearching your log files as easy as surfing the web. DOWNLOAD
SPLUNK!<a class="moz-txt-link-freetext" href="http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click_______________________________________________Webmacro-user">http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click_______________________________________________Webmacro-user</a>
mailing
<a class="moz-txt-link-abbreviated" href="mailto:lis...@li...://lists.sourceforge.net/lists/listinfo/webmacro-userThis">lis...@li...://lists.sourceforge.net/lists/listinfo/webmacro-userThis</a>
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
filesfor problems? Stop! Download the new AJAX search engine that
makessearching your log files as easy as surfing the web. DOWNLOAD
SPLUNK!<a class="moz-txt-link-freetext" href="http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click_______________________________________________Webmacro-user">http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click_______________________________________________Webmacro-user</a>
mailing
<a class="moz-txt-link-abbreviated" href="mailto:lis...@li...://lists.sourceforge.net/lists/listinfo/webmacro-user">lis...@li...://lists.sourceforge.net/lists/listinfo/webmacro-user</a>
------------------------------------------------------- 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!
<a class="moz-txt-link-freetext" href="http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click">http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click</a>
_______________________________________________ Webmacro-user mailing
list <a class="moz-txt-link-abbreviated" href="mailto:Web...@li...">Web...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/webmacro-user">https://lists.sourceforge.net/lists/listinfo/webmacro-user</a>
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!
<a class="moz-txt-link-freetext" href="http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click">http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click</a>
_______________________________________________
Webmacro-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Web...@li...">Web...@li...</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/webmacro-user">https://lists.sourceforge.net/lists/listinfo/webmacro-user</a>
</pre>
</blockquote>
</body>
</html>
|