Java Web Programming and HTTP

Test your knowledge of Java web development including servlets, JSP, WAR files, and HTTP protocols

5 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

What is the syntax for declaring a variable

  1. <%! %>
  2. <%= %>
  3. <% %>
  4. None of the above
Question 2 True/False

Page directive can be declared as <%@ page attributeName="values" %> True or False

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

Name the http method that sends the same response as the request. Select the one correct answer

  1. DEBUG method
  2. OPTIONS method
  3. TRACE method
  4. HEAD method
Question 4 Multiple Choice (Single Answer)

The location where compiled class files will be present within a war file?

  1. /WEB-INF/classes
  2. /classes
  3. /META-INF/classes
  4. /root/classes
Question 5 Multiple Choice (Single Answer)

Name the method defined in the HttpServletResponse class that may be used to set the content type?

  1. setResponseContentType
  2. setContent
  3. setContentType
  4. setType