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.
Questions
Identify the advantages of JSP over Servlet.
- Embedding of Java code in HTML pages
- Platform independence
- Creation of database-driven Web applications
- Server-side programming capabilities
What are the life-cycle methods of JSP?
- jspInit(), _jspService() & jspDestroy()
- init(), service(), destroy()
- doPost()
- none of the above
What is the role of JSP in MVC Model?
- View
- Model
- Controller
- None
What do you understand by JSP translation?
- Parsing JSP using an XML Parser.
- Converting JSP into static Html content.
- Generating Servlet Code for the Jsp
- None
What are the J2EE clients from the below list?
- Applets
- Web Browsers
- Wireless clients.
- All the above
Can we have pure java code inside JSP
- True
- False
Every Custom Servlet extends javax.servlet.http.HttpServlet class
- True
- False
Web container translates JSP to Servlet for every request of the JSP
- True
- False
A JSP page can include another JSP page but not an HTML page
- True
- False
Can we write a constructor for servlet?
- Yes, but always call the default constructor.
- Yes, but you do not have to always call the default constructor.
- No
- None
What are the different scopes available?
- page, request & session
- page, request & application.
- page, request, session & application.
- request, session & application.
Which statement below is true?
- ServletContext gives information about Container
- ServletContext gives information about Request
- ServletContext gives information about Session
- None
Which are implicit objects in a JSP?
- only request, response
- only request, response & application
- request, response, session & application
- none of the above
Difference between GET & POST method. (Choose the right answer)
- Query length is limited in POST, not limited in GET.
- POST is secured whereas data is been submitted as part of URL in GET (not secured).
- By using POST method, we cannot submit the form.
- None