My attention is to prevention duplicated submission.
I have refered to the struts-example.
It checks the valid of token by IsValidToken().
However when a form is displayed at the first time,
it always is invalid.

Moreover, according to the struts-example, it
saveToken when it finds error.

The behavior becomes very strange.

When a form is displayed at the first time, it is
invalid. It leads to error message displaying on web
page. Next time user clicks the submit button, it
becomes valid. Then it cannot avoid duplicated
submission.

All I want is very simple. When user clicks a submit
button. It saves record if data checking is ok.
If user goes back and re-click the submit button.
Duplicated submission can be detected.

Any coding example can be provided?
Or can u point out my mistakes if I provide my
codings?


 --- Michael McGrady <[EMAIL PROTECTED]> 內容:
> Ping Cheung Leung wrote:
> 
> >I have a web page presented by JSP only.
> >No data to input. It contains several links only.
> >
> >If I click one of the links on the web page,
> >It will go to another web page with a form to input
> >data.
> >If I want the form to have a token generated 
> >when the form first appears.
> >How can I code it?
> >
> >The procedure saveToken() is inside an Action
> class.
> >However the JSP file does not have a
> >corresponding ValidatorForm class and Action class.
> >
> >How can a token be generated in a form when the
> form
> >first appears?
> >For instance, when the form is re-directed from a
> JSP
> >file or others?
> >  
> >
> 
> You need to do a little reading or a little research
> into the code on
> how these work. Essentially the idea is that a token
> is saved in request
> and in session scopes and the logic is determined by
> those two being
> compared against each other to allow us to determine
> whether or not a
> person should be able to access the Action class at
> all. So, you need to
> understand that the basic idea is saving, resetting,
> etc. tokens to
> compare against each other.
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
>  

_________________________________________________________
必殺技、飲歌、小星星...
浪漫鈴聲  情心連繫
http://us.rd.yahoo.com/evt=22281/*http://ringtone.yahoo.com.hk/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to