nerdexam
Oracle

1Z0-899 · Question #67

You are creating a servlet that generates stock market graphs. You want to provide the web browser with precise information about the amount of data being sent in the response stream.Which two…

The correct answer is B. response.setContentLength(numberOfBytes); F. response.setIntHeader("Content-Length", numberOfBytes). See the full explanation below for the reasoning.

Question

You are creating a servlet that generates stock market graphs. You want to provide the web browser with precise information about the amount of data being sent in the response stream.Which two HttpServletResponse methods will you use to provide this information? (Choose two.)

Options

  • Aresponse.setLength(numberOfBytes);
  • Bresponse.setContentLength(numberOfBytes);
  • Cresponse.setHeader("Length", numberOfBytes);
  • Dresponse.setIntHeader("Length", numberOfBytes);
  • Eresponse.setHeader("Content-Length", numberOfBytes);
  • Fresponse.setIntHeader("Content-Length", numberOfBytes);

How the community answered

(24 responses)
  • A
    4% (1)
  • B
    83% (20)
  • C
    8% (2)
  • D
    4% (1)

Community Discussion

No community discussion yet for this question.

Full 1Z0-899 Practice