0

I want to show a div if only a cookie exists. And this is how I code it inside JSP file.

<c:if test="${ ! empty cookie['test_cookie']}">
     //some div goes here
   </c:if>

but it always shows the div. What am I doing wrong here?

Jasper de Vries
  • 16,868
  • 6
  • 60
  • 93
Channa
  • 2,797
  • 7
  • 33
  • 66

1 Answers1

0

Check not empty on cookie value: cookie.test_cookie.value:

<c:if test="${not empty cookie.test_cookie.value}">
user7294900
  • 52,490
  • 20
  • 92
  • 189