How to use Struts 2 CSRF token interceptor in Velocity template.
Below is standard JSP example with struts tag
<s:form action="UpdateUser">
<s:textfield name="name" label="User Name">
</s:textfield>
<s:textfield name="address" label="Address">
</s:textfield>
<s:submit name="submit" value="Update">
</s:submit>
<%-- add token to JSP to be used by Token interceptor --%>
<s:token />
</s:form>
Same I want to achieve using Velocity template and want to know how to get token value in Velocity.
What do you want to know about Velocity, is already integrated in Struts 2. You might want to use tags in
velocitytype results. You can learn more about it reading Velocity Tags.For using
tokeninterceptor for CSRF you should read this answer.