It is used in the struts-example.war that ships with the binary distribution
or you can build your own from the source.

If you want to go straight to an example of using tokens, when you deploy
the struts-example.war file open your browser and:

1. Log in to the example
      (the username and password are stored in the
       database.xml file under /struts-example/WEB-INF/)

2. Go to [Edit your user registration profile]

( At this point you will be at the "Current Subscriptions" screen )

3. Open a new browser, using the same session
   (Ctrl + n for IE, copy paste url in new tab for Mozilla,
    NN, Phoenix)

4. Now, in the first browser (or tab), [Add] a new subscription
   (you will be taken back to the "Current Subscriptions" screen
    if you filled in the fields correctly)

5. Use the second browser (or tab) to [Add] another subscription

6. Go back to the first browser and click on the Save button

   Considering the way the example was designed, throughout the
   workflow of this application, nothing is written to disk until
   you save from this spot (that's why its a memory database).

   So, from here we are trying to submit a form which happens to
   have an old token (the current one is within browser #2 form).

   When you submit this page, you should see:

Validation Error

You must correct the following error(s) before proceeding:

    * Cannot submit this form out of order


If you see that message, you have just tested that validation by token
is working properly.


Now that you know the url's, you can trace into the code (by finding
the mappings in the struts-config.xml) and really see what's happening.

Good Luck with it!!!


--
James Mitchell
Software Engineer/Open Source Evangelist
http://www.open-tools.org

"C makes it easy to shoot yourself in the foot; C++ makes it harder, but
when you do, it blows away your whole leg."
- Bjarne Stroustrup




----- Original Message -----
From: "Huy Banh" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, December 31, 2002 2:57 AM
Subject: where can i download struts-example about using tokens


> Hi all,
>
> Im a new Struts, can anyone tell me where i can download Struts-Example
> about using token for testing.
>
> Thanks alot,
> Huy
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to