Test Status
      SERVLETRANDOMTEST
      (A) HttpServlet class
      (B) GenericServlet class
      (C) both A and B
      (D) only A
      (A) servlet.mappings
      (B) servlet.xml
      (C) web.xml
      (D) Simple.java
      (A) response.getOutputWriter()
      (B) response.getWriter()
      (C) response.getWriter().getOutputStream()
      (D) response.getWriter(Writer.OUTPUT_TEXT)
      (A) a
      (B) b
      (C) c
      (D) d
      (A) WAR files must be located in the web application library directory.
      (B) WAR files must contain the web application deployment descriptor.
      (C) WAR files must be created by using archive tools designed specifically for that purpose.
      (D) The web container must serve the content of any META-INF directory located in a WAR file.
      (A) request.getResource("/WEB-INF/myconfig.xml")
      (B) session.getResource("/WEB-INF/myconfig.xml")
      (C) getClass().getResource("/WEB-INF/myconfig.xml")
      (D) context.getResource("/WEB-INF/myconfig.xml")
      (A) response.setLength(numberOfBytes);
      (B) response.setContentLength(numberOfBytes);
      (C) response.setHeader("Length", numberOfBytes);
      (D) response.setIntHeader("Length", numberOfBytes);
      (A) request.addCookie(new Cookie("username", "joe"));
      (B) response.addCookie(new Cookie("username", "joe"));
      (C) response.addCookie("username", "joe");
      (D) request.addCookie("username", "joe");
      (A) Cookie c = request.getCookie("username");
      (B) Cookie c = null; for ( Iterator i = request.getCookies(); i.hasNext(); ) { Cookie o = (Cookie) i.next(); if ( o.getName().equals("username") ) { c = o; break; } }
      (C) Cookie c = null; for ( Enumeration e = request.getCookies(); e.hasMoreElements(); ) { Cookie o = (Cookie) e.nextElement(); if ( o.getName().equals("username") ) { c = o; break; } }
      (D) Cookie c = null; Cookie[] cookies = request.getCookies(); for ( int i = 0; i < cookies.length; i++ ) { if ( cookies[i].getName().equals("username") ) { c = cookies[i]; break; } }
      (A) Servlets executes slower compared to CGI
      (B) Servlets are thread based and CGI is process based
      (C) Servlet has no platform specific API, where as CGI has
      (D) All of the above