Getting cookie in JSP

后端 未结 2 1058
走了就别回头了
走了就别回头了 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:50

    use jsp expression language it has implicit map of cookies. may be it can resolve your issue.

    ${cookie['name']}
    

提交回复
热议问题