123456789101112131415



Question 1: Given: String value = getServletContext().getInitParameter("foo"); in an HttpServlet
and a web application deployment descriptor that contains:
<context-param> <param-name>foo</param-name>
<param-value>frodo</param-value></context-param>
Which one are true?

1. The foo initialization parameter CANNOT be set programmatically.
2. Compilation fails because getInitParameter returns type Object.
3. Compilation fails because ServletContext does NOT have a getInitParameter
method.
4. The foo parameter must be defined within the <servlet> element of the
deployment descriptor.