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>

Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine

Session timeout interceptor in struts 2