JSP and Servlet Quiz

Test your knowledge of Java Server Pages (JSP) and Servlets including lifecycle, syntax, and execution in web containers like Tomcat.

9 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

In JSP, how can you know what HTTP method (GET or POST) is used by client request ?

  1. by using request.getMethod()
  2. by using request.setMethod()
  3. impossible to know
  4. none of these
Question 2 Multiple Choice (Single Answer)

What is legal about JSP scriplets

  1. A loop can begin in one Scriptlet and end in another
  2. Statements in Scriptlets should follow Java Syntax
  3. Semicolon is needed at the end of each statement in a Scriptlet
  4. All the above
Question 3 Multiple Choice (Single Answer)

Which method is called first each time a Servlet is invoked ?

  1. Start()
  2. Run()
  3. Servive()
  4. init()
Question 4 Multiple Choice (Single Answer)

A JSP is transformed into a(n):

  1. Java applet.
  2. Java servlet.
  3. Either 1 or 2 above.
  4. Neither 1 nor 2 above.
Question 5 Multiple Choice (Single Answer)

What programming language(s) or scripting language(s) does Java Server Pages (JSP) support?

  1. VBScript only
  2. Jscript only
  3. Java only
  4. All of the above are supported
Question 6 Multiple Choice (Single Answer)

What servlet processor was developed by Apache Foundation and Sun?

  1. Apache Tomcat
  2. Apache Web server
  3. Sun servlet processor
  4. None of the above is correct.
Question 7 Multiple Choice (Single Answer)

What is invoked via HTTP on the Web server computer when it responds to requests from a user's Web browser?

  1. A Java application
  2. A Java applet
  3. A Java servlet
  4. None of the above is correct.
Question 8 Multiple Choice (Single Answer)

How many copies of a JSP page can be in memory at a time?

  1. One
  2. Two
  3. Three
  4. Unlimited
Question 9 Multiple Choice (Single Answer)

How does Tomcat execute a JSP?

  1. As a CGI script
  2. As an independent process
  3. By one of Tomcat's threads
  4. None of the above is correct.