This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Customer Requirements for Developers and have Marcho Behler on-line!
See this thread for details.
The moose likes Struts and the fly likes how to use token in struts 2 application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Customer Requirements for Developers this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "how to use token in struts 2 application" Watch "how to use token in struts 2 application" New topic
Author

how to use token in struts 2 application

Maurya Rajdev
Greenhorn

Joined: Apr 16, 2009
Posts: 1
Hi ,

how to use token in struts 2 application tell me with example.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Use an interceptor stack that includes the "token" interceptor. Put the <s:token/> tag in your form. That's it.
Mudit Srivastava
Ranch Hand

Joined: Apr 30, 2007
Posts: 38
Adding onto what David said, it's wiser using a TokenSessionInterceptor in case you want to block the duplicate request
and returns the result from the initial request.
TokenSessionInterceptor
Leonardo Carreira
Ranch Hand

Joined: Apr 07, 2009
Posts: 489

Hi Friends...

i use velocity template engine as my view...
is it possible to use token in velocity?..

The tag <s:token/> is only for JSP..
is it any token tag in velocity?...
iam using velocity 1.6..

Thanks in advance all...


Sorry, perhaps my english language isn't too good.. Prepare for SCJP 6, Please God help me.. ☼
References : [Java.Boot] [JavaChamp] [JavaPrepare]
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Are you saying there's no #stoken?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to use token in struts 2 application
 
It's not a secret anymore!