This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes HFSJ page 386-Not in errata Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "HFSJ page 386-Not in errata" Watch "HFSJ page 386-Not in errata" New topic

HFSJ page 386-Not in errata

Renu Radhika
Ranch Hand

Joined: Oct 21, 2005
Posts: 243
In HFSJ page 386,its mentioned that to get the values of a cookie named username using EL,we have to give ${cookie.userName.value}.Cant we get it using ${cookie.userName} like other objects?is the �.value� required?is it a mistake?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

cookie is an implicit object whose type is Map. It contains Cookie objects.
${cookie.userName} will return a Cookie. If you want its value, you'll have to call Cookie#getValue. So ${cookie.userName.value} is the right way to do it.

[My Blog]
All roads lead to JavaRanch
It is sorta covered in the JavaRanch Style Guide.
subject: HFSJ page 386-Not in errata
It's not a secret anymore!