| 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: 14672
|
|
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!
|
 |
 |
|
|
subject: applicationScope in EL
|
|
|