• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

applicationScope in EL

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Srinu Nanduri
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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"?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
28) All wrong. They should use initParam instead of applicationScope.
32) You're right. They probably meant paramValues.
 
Srinu Nanduri
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Christophe!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic