CIT597 Quiz 5
Fall, 2002
Name_________________________________________
  1. (8 points) What is the name of the class whose objects describe classes? Class

  2. (8 points) What is the name of the most popular Web server? Apache

  3. (8 points) HTTP requests go by default to which port number? 80

  4. (8 points) Why are servlets more efficient than CGI scripts?
    They do not need to be reloaded and restarted for each request.

  5. (5 points) Which can hold more information, a GET or a POST request? POST

  6. (10 points) In general terms (don't write any code), how does the doPost method create and return a response to the request?
    Use the HttpServletResponse parameter to get a PrintWriter, and output the response onto that stream.


  7. (8 points) Name one difference between an Enumeration and an Iterator.
    An Iterator has shorter method names (not "Enumeration" is shorter than "Iterator").
    An Iterator supports a remove() method.
    5 points for "Enumeration is older"
  8. (8 points) If s is a String containing only digits, and n is an int variable, write one line of code to convert s to an int and assign the result to n.
    n = new Integer(s).intValue();

  9. (12 points, 6 each) What do each of the following acronyms stand for?

    1. CGI
      Common Gateway Interface
    2. HTTP
      Hypertest Transfer Protocol
  10. (9 points, 3 each) List the three parts of an HTTP message.

    1.  The request or response line.

    2.  The header section.

    3.  The body.

  11. (8 points, 2 each) Where are cookies created? On the server.

    Where are they stored? On the client.

    What program can put a cookie in an email? Outlook Express

    Cookies are not a security threat, but they can be a(n) privacy threat.

  12. (8 points, 2 each) True or false:

    TRUE Given any object, a Java program can determine what messages it can respond to.

    TRUE A Java array may have zero length.

    TRUE A cookie can maintain information longer than a single session.

    TRUE The Session Tracking API uses cookies.