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 applicationScope in EL 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 "applicationScope in EL" Watch "applicationScope in EL" New topic
Author

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,
<context-param>
<param-name>maxConnections</param-name>
<param-value>37</param-value>
</context-param>
Which of the following EL expressions rightly access the value of the parameter
'maxConnections'?
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?


SCJP, SCWCD
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é
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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: http://aspose.com/file-tools
 
subject: applicationScope in EL