aspose file tools*
The moose likes JSP and the fly likes get specific cookie? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "get specific cookie?" Watch "get specific cookie?" New topic
Author

get specific cookie?

Rob Deer
Greenhorn

Joined: Jan 10, 2005
Posts: 17
all the examples i've seen to get cookies is to use getKookies, store them into an array and loop through'em . is there a way to get a specific cookie like id:20 in one step?
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 31057
    
232

Ester,
Welcome to JavaRanch!

Yes, you need to loop through the cookie array. If you somehow knew the index of the cookie in the array you could go right to it. However, the cookies are not in any particular order. So you need to loop through each one to get the cookie name and see if it is the one you are interested in.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Sumitro Palit
Ranch Hand

Joined: Dec 13, 2003
Posts: 37
In JSP 2.0 you can use EL to achieve this.
The syntax is ${wookie.wookiename}.
So, if your wookie name is id and stores a value 20,
${wookie.id} will output 20.

Please replace "w" in all "wookie"s with 'c'
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get specific cookie?