This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question in SCWCD mock exams to be discussed
 
Similar Threads
another EL doubt
desperately Need help with EL....
== question
classpath for the .java
doubt on two questions..(Topic:: Session Migration & EL)