I am trying to check that attribute in http session storage called "username" is there/not there in http session storage. If it is in http session storage it will show a button. If is not in http session storage the button should not be shown.
I have tried the following methods, both do not seem to work
First method: Review button shows up when "username" both when "username" is in http storage and not in http storage
<%
String username1 = (String) session.getAttribute("username");
%>
<c:if test = "${username1.length()!=0}">
<button class="btn btn-primary" style="background-color: #887775; border: none;" id="myBtn">Write a review</button>
</c:if>
Second method: Review button does not show up at all whether "username" is there or not there in http session storage
<%
String username1 = (String) session.getAttribute("username");
%>
<c:if test = "${username1.isEmpty()==true}">
<button class="btn btn-primary" style="background-color: #887775; border: none;" id="myBtn">Write a review</button>
</c:if>
Any help will be appreciated!