File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to access Cookie value using EL

 
Mike lothar
Greenhorn
Posts: 22
  • 0
  • 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
  • 0
  • 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
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Giju George

Mike
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic