문제

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