Multiple choice technology web technology

Which directives specify an HTTP response that will be of type "image/svg"?(Choose all that apply)

  1. <%@ page type="image/svg" %>

  2. <%@ page mimeType="image/svg" %>

  3. <%@ page language="image/svg" %>

  4. <%@ page contentType="image/svg" %>

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

The correct JSP directive to set HTTP response content type is '<%@ page contentType="image/svg" %>'. The contentType attribute specifies the MIME type. Options A (type), B (mimeType), and C (language) are not valid attributes for setting response content type.

AI explanation

To answer this question, we need to understand the directives used to specify the HTTP response type.

Option A) <%@ page type="image/svg" %> - This option is incorrect because the "type" attribute is not used to specify the HTTP response type. It is used to specify the content type of the page being included.

Option B) <%@ page mimeType="image/svg" %> - This option is incorrect because the "mimeType" attribute is not used to specify the HTTP response type. It is used to specify the MIME type of the page being included.

Option C) <%@ page language="image/svg" %> - This option is incorrect because the "language" attribute is not used to specify the HTTP response type. It is used to specify the scripting language used in the page.

Option D) <%@ page contentType="image/svg" %> - This option is correct because the "contentType" attribute is used to specify the HTTP response type. In this case, it specifies that the response will be of type "image/svg".

Therefore, the correct answer is D) <%@ page contentType="image/svg" %>. This option is correct because it uses the appropriate directive to specify the HTTP response type as "image/svg".