• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to access Cookie value using EL

 
Mike lothar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
How to access Cookie value using EL. i tried to access cookie using EL its printing characters which are not meaningful.

Thank you
Mike
 
Giju George
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The cookies are stored as Map (name -value pairs). So if you create a cookie like :-

Cookie c=new Cookie("c1","My test cookie");
response.addCookie(c);

Then you can access it using the following EL in jsp :-

Cookie :- ${cookie["c1"].value}


Hope this helps
 
Mike lothar
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Giju George

Mike
 
Everybody's invited. Except this tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!