Getting cookie in JSP

后端 未结 2 1061
走了就别回头了
走了就别回头了 2020-12-19 12:07

I can get cookie in JSP like this:

Cookie[] cookies = request.getCookies();
if (cookies != null) {
    for (Cookie cookie : cookies) {
        //work with co         


        
2条回答
  •  难免孤独
    2020-12-19 12:42

    hope this one could help you to get name and value of your cookie

    ${cookie['cookiename'].getName()}
    ${cookie['cookiename'].getValue()}
    

    OR

    ${cookie.cookiename.getName()}
    ${cookie.cookiename.getValue()}
    

    OR

    ${cookie..name}
    ${cookie..value}
    

提交回复
热议问题