![]() |
JBridge: Certification Question Of The Day |
| JBridge Home >> Certification Questions >> Question for Wednesday May 14th 2003 | Wednesday May 14th 2003 |
|
Identify true statements about the following servlet code (the line numbers are not part of the code) (2 correct answers)
11 RequestDispatcher rd = request.getRequestDispatcher("/InventoryServlet");
12 PrintWriter out = response.getWriter();
13 out.write("Inventory Report");
14 rd.forward(request, response);
15 out.flush();
16 out.close();
A The servlet will not run, as it will not compile. B The output from "InventoryServlet" is returned to the requester. C The output from "InventoryServlet" is returned to the requester, prefaced by the words "Inventory Report". D A runtime error occurs at line 14. E Lines 15 and 16 do not execute. F Lines 15 and 16 do execute. G Lines 15 and 16 do not necessarily execute (it depends on the servlet container implementation) H In line 11, the "/" in "/InventoryServlet" is incorrect. Only a RequestDispatcher returned from ServletContext can have a getRequestDispatcher parameter beginning with a "/". Page down for the answer... The AnswerB and F are the correct answers. |
EMail: dbridgewater@jbridge.co.uk
Phone: +44 (0)1943 877414
Fax: +44 (0)1943 877414
Mail: David Bridgewater, Willow Dene, Bradford Road, Menston, Ilkley, West Yorkshire, LS29 6ED, UK
Copyright © 2003 David Bridgewater. All rights reserved.