IT Certificaions

Google Cloud Platform

Wednesday, July 20, 2011

How to get session attribute in struts 2 tag

                           How to get session attribute in struts 2  <s:if test> tag


<s:if test='%{#session.USERID != null}' >
        // do something
</s:if>
<s:else if test='%{#session.USERID =="admin"}' >
   // if user is admin in USERID attribute of session, do something
  </s:else if>

<s:else>
   //do other things
</s:else>