JSP and Servlet Quiz
Test your knowledge of Java Server Pages (JSP) and Servlets including lifecycle, syntax, and execution in web containers like Tomcat.
Questions
Question 1 Multiple Choice (Single Answer)
In JSP, how can you know what HTTP method (GET or POST) is used by client request ?
- by using request.getMethod()
- by using request.setMethod()
- impossible to know
- none of these
Question 2 Multiple Choice (Single Answer)
What is legal about JSP scriplets
- A loop can begin in one Scriptlet and end in another
- Statements in Scriptlets should follow Java Syntax
- Semicolon is needed at the end of each statement in a Scriptlet
- All the above
Question 3 Multiple Choice (Single Answer)
Which method is called first each time a Servlet is invoked ?
- Start()
- Run()
- Servive()
- init()
Question 4 Multiple Choice (Single Answer)
A JSP is transformed into a(n):
- Java applet.
- Java servlet.
- Either 1 or 2 above.
- 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?
- VBScript only
- Jscript only
- Java only
- All of the above are supported
Question 6 Multiple Choice (Single Answer)
What servlet processor was developed by Apache Foundation and Sun?
- Apache Tomcat
- Apache Web server
- Sun servlet processor
- 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?
- A Java application
- A Java applet
- A Java servlet
- 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?
- One
- Two
- Three
- Unlimited
Question 9 Multiple Choice (Single Answer)
How does Tomcat execute a JSP?
- As a CGI script
- As an independent process
- By one of Tomcat's threads
- None of the above is correct.