• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Do I have the Prerequisite for taking OCPJWCD?

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to take the Oracle Certified JSP/Servlets test, but I wonder if I have to take the Programmer test first. I have the Sun Certified Programmer for the Java 2 Platform in 2001. I noticed that Oracle says "SCJP Professional any version" as requirement. I am baffled by the word 'Professional".
Also I am reading the HF JSP and Servlets now. I have a question about EL with Cookie implicit object. Wouldn't ${cookie.userName} print the value of the cookie named username, since cookie is a Map object anyway. Why do we need the cumbersome syntax ${ cookie.userName.value}?
Thanks.
 
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

First, I would never put the username in a cookie. Cookies should only contain one unique but meaningless value example: 4832e2e2483ad561481693194232afa195607787


have a question about EL with Cookie implicit object. Wouldn't ${cookie.userName} print the value of the cookie named username, since cookie is a Map object anyway. Why do we need the cumbersome syntax ${ cookie.userName.value}?



A map has key,values pairs. So it seems logical to specifically retrieve the value.
 
H Yin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

A.J. Côté wrote:
A map has key,values pairs. So it seems logical to specifically retrieve the value.


But logically, if you provide a key to a map, would it automatically return the value? Do you need specifically say "value"?
What else would you expect to return? like ${cookie.userName.key}?
Thanks
 
A.J. Côté
Ranch Hand
Posts: 417
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't tested it but ${cookie.userName} might return the Entry which contains both the key and the value. This is just a guess...

https://docs.oracle.com/javase/7/docs/api/java/util/Map.Entry.html
 
Creator of Enthuware JWS+ V6
Posts: 3411
320
Android Eclipse IDE Chrome
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that for any Map you can get the value in three ways:


EL has a number of implicit objects of which "cookie" has a description of "A map of HttpServletRequest cookie names and cookie objects". In other words ${cookie.userName} will return the Cookie with name "userName" and note that userName is the key in the map. The value is the Cookie object itself, and from the Cookie class you can see that you can get the "value" by calling getValue.


 
H Yin
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. I understand now.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic