Java Web Development - Servlets and JSP

Test your knowledge of Java web development including Servlets, JSP (JavaServer Pages), HTTP methods, scopes, and web application concepts.

14 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Identify the advantages of JSP over Servlet.

  1. Embedding of Java code in HTML pages
  2. Platform independence
  3. Creation of database-driven Web applications
  4. Server-side programming capabilities
Question 2 Multiple Choice (Single Answer)

What are the life-cycle methods of JSP?

  1. jspInit(), _jspService() & jspDestroy()
  2. init(), service(), destroy()
  3. doPost()
  4. none of the above
Question 3 Multiple Choice (Single Answer)

What is the role of JSP in MVC Model?

  1. View
  2. Model
  3. Controller
  4. None
Question 4 Multiple Choice (Single Answer)

What do you understand by JSP translation?

  1. Parsing JSP using an XML Parser.
  2. Converting JSP into static Html content.
  3. Generating Servlet Code for the Jsp
  4. None
Question 5 Multiple Choice (Single Answer)

What are the J2EE clients from the below list?

  1. Applets
  2. Web Browsers
  3. Wireless clients.
  4. All the above
Question 6 True/False

Can we have pure java code inside JSP

  1. True
  2. False
Question 7 True/False

Every Custom Servlet extends javax.servlet.http.HttpServlet class

  1. True
  2. False
Question 8 True/False

Web container translates JSP to Servlet for every request of the JSP

  1. True
  2. False
Question 9 True/False

A JSP page can include another JSP page but not an HTML page

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

Can we write a constructor for servlet?

  1. Yes, but always call the default constructor.
  2. Yes, but you do not have to always call the default constructor.
  3. No
  4. None
Question 11 Multiple Choice (Single Answer)

What are the different scopes available?

  1. page, request & session
  2. page, request & application.
  3. page, request, session & application.
  4. request, session & application.
Question 12 Multiple Choice (Single Answer)

Which statement below is true?

  1. ServletContext gives information about Container
  2. ServletContext gives information about Request
  3. ServletContext gives information about Session
  4. None
Question 13 Multiple Choice (Single Answer)

Which are implicit objects in a JSP?

  1. only request, response
  2. only request, response & application
  3. request, response, session & application
  4. none of the above
Question 14 Multiple Choice (Single Answer)

Difference between GET & POST method. (Choose the right answer)

  1. Query length is limited in POST, not limited in GET.
  2. POST is secured whereas data is been submitted as part of URL in GET (not secured).
  3. By using POST method, we cannot submit the form.
  4. None