File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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
doubt on two questions..(Topic:: Session Migration & EL)
classpath for the .java
another EL doubt
desperately Need help with EL....
== question