Check if Cookie exists with JSP EL

前端 未结 4 952
-上瘾入骨i
-上瘾入骨i 2020-12-16 22:59

I am trying to check if a cookie exists on a JSP page using the Expression Language.

I have a cookie called persist which is set to either empty string

4条回答
  •  盖世英雄少女心
    2020-12-16 23:22

    If I understand correctly, you want to detect that it either doesn't exist or is empty.

    EDIT: ah. To verify that it doesn't exist, it must be null and not empty.

        
       Cookie doesn't exist
        
    

提交回复
热议问题