سؤال

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