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
  • 19,370
  • 6
  • 64
  • 102
Channa
  • 3,267
  • 7
  • 41
  • 67

1 Answers1

0

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

<c:if test="${not empty cookie.test_cookie.value}">
Ori Marko
  • 56,308
  • 23
  • 131
  • 233