Multiple choice technology web technology

What is wrong with the following code?

  1. Cookie class can not take parameters in it's constructor

  2. The request object is used for creating cookies

  3. Although no error will be reported the use of the <jsp:include/> action means that the response object can't be used to create cookies

  4. The <jsp:include/> action must be placed inside the script block

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The action flushes the response buffer before including the target resource. Once headers are sent (which happens during the flush), you cannot set cookies because cookies require HTTP headers. Any attempt to add cookies via response.addCookie() after a jsp:include will fail or be ignored.