How to rename the Struts2 Token Parameters?

if we use <s:token/> tag while form submit by default Struts2 will generate URL something like this

?name=name&struts.token.name=struts.token&struts.token=8E1USQZ5LHG120FU4YUZJAMPOUT4OVP3

by using this <s:token name="suid"/> tag we can rename the "struts.token" parameter. Struts2 will generate URL something like this

?name=name&struts.token.name=suid&suid=8E1USQZ5LHG120FU4YUZJAMPOUT4OVP3

How can we rename the "struts.token.name" parameter?

有帮助吗?

解决方案

The parameter is used by the TokenHelper. There no extension points are given for this bean. You can provide your own implementation by extending token interceptors and overriding their methods only and replace references of token helper inside them.

You should check this links:

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top