![]() |
JBridge: Certification Question Of The Day |
| JBridge Home >> Certification Questions >> Question for Thursday May 15th | Thursday May 15th |
|
Identify true statements about the following servlet code? (the line numbers are not part of the code) (1 correct answer)
11 RequestDispatcher rd = request.getRequestDispatcher("/InventoryServlet");
12 PrintWriter out = response.getWriter();
13 out.write("Inventory Report");
14 out.flush();
15 out.close();
16 rd.include(request, response);
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 16, giving rise to an IllegalStateException. E Line 16 does not execute. F In line 11, the "/" in "/InventoryServlet" is incorrect. Only a RequestDispatcher returned from ServletContext can have a getRequestDispatcher parameter beginning with a "/". G Only the words "Inventory Report" are returned to the requester. Page down for the answer... The AnswerG is the correct answer. |
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.