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

Read Images from a xlsx file using Apache POI

Read Excel using Apache POI - Exception in thread "main" org.apache.poi.poifs.filesystem.OfficeXmlFileException:

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