This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes applicationScope in EL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "applicationScope in EL" Watch "applicationScope in EL" New topic

applicationScope in EL

Srinu Nanduri
Ranch Hand

Joined: Mar 20, 2006
Posts: 42
The following is a mock exam question from Javabeat.

28) The Deployment Descriptor for a Web Application looks like this,
Which of the following EL expressions rightly access the value of the parameter
a. ${applicationScope.maxConnections}
b. ${applicationScope["maxConnections"]}
c. ${applicationScope['maxConnections']}
d. All the above

I dont think any of the above four is a right answer. All that we can access through the applicationScope are just the attributes bound to the application scope. Is my understanding right?

Srinu Nanduri
Ranch Hand

Joined: Mar 20, 2006
Posts: 42
another one in the same line..

32) Which of the following are equivalent forms for the Scriptlet?
String gradeValues[] = request.getParameterValues("grades");
String value = gradeValues[0];
a. ${requestValues.grades['0']}
b. ${requestValues.grades.0}
c. ${requestValues.grades['0']}
d. ${requestValues.grades."0"}
e. ${requestValues.grades["0"]}
f. ${requestValues.grades.'0'}
g. All the above

I wonder if there is an implicit object by name "requestValues"?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

28) All wrong. They should use initParam instead of applicationScope.
32) You're right. They probably meant paramValues.

[My Blog]
All roads lead to JavaRanch
Srinu Nanduri
Ranch Hand

Joined: Mar 20, 2006
Posts: 42
Thanks Christophe!
I agree. Here's the link:
subject: applicationScope in EL
It's not a secret anymore!