title: Struts2 dynamic url action in IBM Portal
body: <p>I'm trying to create a dynamic menu bar using struts2 url tag. I got the list of menus from webservice and try to generate corresponding URL to each menu.
  I tried this code</p>
  
  <pre><code>&lt;s:iterator value="roleMenus" id="child"&gt;
  &lt;s:if test="parentCode == #parent.childCode"&gt;
      &lt;s:if test="childCode != #parent.childCode"&gt;
          &lt;c:set var="link"&gt;&lt;s:property value='menuLink'/&gt;&lt;/c:set&gt;
          &lt;% menulink = (String)pageContext.getAttribute("link"); 
              System.out.println(menulink);%&gt;
          &lt;li&gt;&lt;a id='&lt;s:property value="menuLink"/&gt;' name="menulink" href="&lt;s:url action='xxxxx'/&gt;"&gt;&lt;s:property value="menuName"/&gt;&lt;/a&gt;&lt;/li&gt;
      &lt;/s:if&gt;
  &lt;/s:if&gt;
  </code></pre>
  
  <p></p>
  
  <p>with Action attribute value passed in scriptlet</p>
  
  <pre><code>&lt;%=menuLink%&gt;
  </code></pre>
  
  <p>or JSTL variable</p>
  
  <pre><code>${link}
  </code></pre>
  
  <p>but it throws an exception</p>
  
  <pre><code>According to TLD or attribute directive in tag file, attribute "[action]" does not accept any expressions.
  </code></pre>
  
  <p>so I guess this cannot be done using any kind of dynamic expressions in Action attribute.</p>
  
  <p>I'm thinking of overriding the method that generates URL when s:url tag get called but I don't have a clue how to do that. It generates urls like this in IBM Portal:</p>
  
  <pre><code>/wps/myportal/!ut/p/b1/jZDbToNAFEW_pR9gzhmG6-OEyMVhUGCowAsh2BiQS6yI0q-X9qkm1va87WSt7J0DBeTE1C2dWhrVIYNiqObmtZqacai6Yy70MmSpw9mTio9oOujHWkKpESnoHoX8HEBCcAU8LVWEUNZ4m2-7zFONANEMXA195qWxFVGKjF7zn6H4jfyx4AT8V3EC8MIxhNAb-x3kK2Zc3GIiZHOz-4LtMO779XUSMlTLpF3GT56ME3_J94ttvi_p24T1HEoctu1yCKRNs28tFtI2Hg6ilC2JCLO7KKxbkWA_obgj3Knvmctn7n9soC86x_JbNffZ5gdG203G/dl4/d5/L0lDU0NtbUEhL3dPb0JKaVVNcHJDSy80RzNhRFVRZy9aN19OQVVGS0FQNDBPMDhGMElSNVMzMzdRMjA4MC8lMHZpZXclMEFwcExvZw!!/
  </code></pre>
  
  <p>Does anyone have any ideas for this? Any help will be very much appreciated.</p>