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>

Comments

Popular posts from this blog

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'

Upload csv file at Google Cloud Storage using java

Read Images from a xlsx file using Apache POI