The questions in this quiz on JavaServer Pages are on the topics covered in the second lesson of the JSP section of the site. The table below lists the lesson used for each quiz, a description of the lesson content and the quiz number and questions associated with that lesson.
Click on a lesson in the table to go to that lesson for a refresher on the topics for that quiz.
Click on a quiz in the table to go straight to the quiz for a particular lesson.
|Lesson 1 - Introduction to JSP||In this lesson we begin our studies of using JavaServer Pages (JSPs).||Quiz1|
|Lesson 2 - JSP Lifecycle||In this lesson we make a much deeper inpsection of JSPs by looking at the JSP lifecycle and the mechanics of how a JSP is translated into a full-blown servlet.||This quiz.|
|Lesson 3 - JSP Page Anatomy||In this lesson we look at the anatomy of JSP by investigating the various components that can be used within a JSP page.||Quiz3|
|Lesson 4 - Implicit Objects||In this lesson is all about the implicit objects available for use with JSP.||Quiz4|
|Lesson 5 - JSP Directives||In this lesson we will take a much closer look at the |
include directives which along with the
taglib directive are the only directives which can be included in a JSP page.
|Lesson 6 - Our First Servlet||In this lesson we look at the different Java-based scripting elements available and how we can use them.||Quiz6|
|Lesson 7 - JavaBean Standard Actions||In this lesson we look at jsp standard actions that relate to JavaBeans and how to use them within our JSP pages.||Quiz7|
|Lesson 8 - Other JSP Standard Actions||In our second lesson on JSP standard actions we look at the |
jsp:param standard actions and how to use them.
JavaServer Pages Quiz
The quiz below tests your knowledge of the material learnt in the JSP Lifecycle lesson of the JSP section of the site.
Question 1 : What is the first stage in the JSP lifecycle?
- The first stage in the JSP lifecycle is <i>translation</i> when the container attempts to translate the JSP page into a JSP implementation page.
Question 2 : How many JSP lifecycle methods are there?
- There are three JSP lifecycle methods, these being <code>jspInit()</code>, <code>_jspService()</code> and <code>jspDestroy()</code>.
Question 3 : Which of these JSP lifecycle stages comes first?
- The container has to instantiate a JSP Servlet before we initialise it.
Question 4 : How many stages are there in the JSP lifecycle?
- There are seven stages in the JSP lifecycle, these being class translation, compilation, loading, instantiation, initialisation, servicing and destruction.
Question 5 : JSP Servlets get loaded by the container on server statup?
- JSP Servlets are lazily initialised and get loaded by the container when required unless instructed to within the DD using the <code>load-on-startup</code> sub-element of the <code>servlet</code> top-level element.
Question 6 : Each JSP servlet gets one of which of the following objects?
- Each JSP servlet gets a <code>ServletConfig</code> object.
Question 7 : The _jspDestroy() lifecycle method will always run for a servlet?
- If a JSP servlet has failed during the initialisation stage of the lifecycle, then no JSP servlet exists to be destroyed as the resources were not configuered correctly and hence the <code>_jspDestroy()</code> method doesn't get invoked.
Quiz Progress Bar Please select an answer
The next quiz is on JSP Page Anatomy.