title: Modify the token returned by Struts2 s:token tag
body: <p>In a Struts 2 webapp (which also uses Spring), 
  I want to modify the <code>"output"</code> of the <a href="https://struts.apache.org/docs/token.html" rel="nofollow"><code>&lt;s:token&gt;</code></a> tag to use my own token-generation algorithm.</p>
  
  <p>It appears the <code>&lt;s:token&gt;</code> tag is handled by a class called <a href="http://grepcode.com/file/repo1.maven.org/maven2/org.apache.struts/struts2-core/2.3.12/org/apache/struts2/components/Token.java" rel="nofollow"><code>org.apache.struts2.components.Token</code></a>, which is a <a href="http://grepcode.com/file/repo1.maven.org/maven2/org.apache.struts/struts2-core/2.3.12/org/apache/struts2/components/UIBean.java#UIBean" rel="nofollow"><code>UIBean</code></a>. Is there a standard way using either Struts or Spring by which I can "extend" or "modify" or replace the <code>Token</code> class, or the methods it uses to generate tokens?</p>
  
  <p>Alternatively, can I make up my own <code>&lt;mytoken&gt;</code> tag that works in Struts 2?</p>