• 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

Question from David Bridgewater's Book

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Guys,

16. Which of the following techniques is likely to return an initialization parameter for a JSP page?
(Choose two.)
A. <%= request.getParameter(�myParm�) %>
B. <% String s = getInitParameter(�myParm�); %>
C. <% = application.getInitParameter(�myParm�) %>
D. <%= confi g.getInitParameter(�myParm�); %>
E. <%= getParameter(�myParm�) %>
F. <% Object o = confi g.getParameter(�myParm�); %>
G. <% String s = confi g.getAttribute(�myParm�); %>
H. <% String s = getAttribute(�myParm�); %>

Answer I choose was C and D but book says B and D??
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"application" will refer to the servlet context (common for the application) but not the servlet config (defined for the particular servlet/jsp page).
 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can the option B be true ? Does the genetated servlet (from jsp)extends from GenericServlet ? Or Implements ServletConfig ?
[ October 11, 2007: Message edited by: Amit Goyal ]
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got my mistake. Thanks for pointing!
 
Thuwaragan Sundaramoorthy
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try the following example if you want:




jsp also transformed to an HttpServlet.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic