Multiple choices 11/50
(Choose 1 answer)
A. "Initialization Parameter is:
Next
sun.jdbc.odbc.JdbcOdbcDriver" returned to the requester
B. "Initialization Parameter is: null" written to the console
C. A runtime error
D. "Initialization Parameter is: null" returned to the requester
Given the following deployment descriptor:
<web-app>
< context-param>
<param-name>jdbcDriver</param-name>
<param-value>sun.jdbc.odbc.JdbcOdbcDriver</param-value>
</context-param>
<servlet>
<servlet-name>InitParams</servlet-name>
<servlet-class>InitParamsServlet</servlet-class>
</servlet>
</web-app>
What is the outcome of running the following servlet? (Choose one.)
public class InitParamsServlet extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { ServletContext sc = this.getServletContext();PrintWriter out = response.getWriter();out.write("Initialization Parameter is: " + sc.getInitParameter("jdbcDriver"));
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 21 22
23
24 25 26 27 28 29 30 31
32
33
34
35
36
37
38
39
40
41
42
49 50
43 44 45 46 47 48