wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question in SCWCD mock exams to be discussed Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question in SCWCD mock exams to be discussed" Watch "Question in SCWCD mock exams to be discussed" New topic
Author

Question in SCWCD mock exams to be discussed

Yahya El-Ganzoury
Greenhorn

Joined: Jul 30, 2006
Posts: 6
111. given

11. com.example.Advisor advisor = new com.CodeRanch.Advisor();
12. request.setAttribute(“foo”, advisor);
Assuming there are no other “foo” attributes in the web application, which three are valid EL expressions for retrieving the advice property of advisor? (Choose three.)

#1. ${foo.advice}
#2. ${request.foo.advice}
#3. ${requestScope.foo.advice}
#4. ${requesstScope[foo[advice]]}
#5. ${requestScope[“foo”][advice]}
#6. ${requestScope[“foo”][@advice”]]}
what should be the answer?
For me, I see that it should be 1, 3, and 5.

Tyler Wright
Ranch Hand

Joined: Jun 25, 2009
Posts: 40
Hi Yahya,

Yes

I just coded this up and got that answers 1, 3, and 5 all worked...
However, I assumed that you meant to type:
#5. ${requestScope[“foo”]["advice"]} <-- this works

#5. ${requestScope[“foo”][advice]} <-- this DOES NOT work

regards,
Tyler


SCJP SCJD
Yahya El-Ganzoury
Greenhorn

Joined: Jul 30, 2006
Posts: 6
Hi Tyler,

Tyler Wright wrote:

#5. ${requestScope[“foo”]["advice"]} <-- this works

#5. ${requestScope[“foo”][advice]} <-- this DOES NOT work


Yes, you are right.
Thanks
 
Consider Paul's rocket mass heater.
 
subject: Question in SCWCD mock exams to be discussed
 
Similar Threads
== question
desperately Need help with EL....
classpath for the .java
doubt on two questions..(Topic:: Session Migration & EL)
another EL doubt