The document outlines key concepts in Java web development, focusing on Servlets and JSP, including the Servlet lifecycle and the differences between GenericServlet and HttpServlet. It also covers the integration of Spring and Hibernate, explaining Dependency Injection, the Hibernate ORM lifecycle, and how to build a web application that performs CRUD operations. Additionally, it discusses JSP directives and the differences between JSP scriptlets, declarations, and expressions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
6 views
java unit 3
The document outlines key concepts in Java web development, focusing on Servlets and JSP, including the Servlet lifecycle and the differences between GenericServlet and HttpServlet. It also covers the integration of Spring and Hibernate, explaining Dependency Injection, the Hibernate ORM lifecycle, and how to build a web application that performs CRUD operations. Additionally, it discusses JSP directives and the differences between JSP scriptlets, declarations, and expressions.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1
Unit 3 Java by HVS
Servlets & JSP
1. Explain the complete Servlet lifecycle. How do init(), service() and destroy() methods work together in a web application? Include their role in memory management and performance. 2. Compare and contrast GenericServlet and HttpServlet. Why is HttpServlet preferred in web applications? Illustrate with an example. 3. Demonstrate how to build a web application where an HTML form sends data to a Servlet, and the Servlet processes it and stores it in a database using JDBC. Include sample code. 4. Explain the difference between ServletConfig and ServletContext. How do you use them to read initialization parameters, and what are the scopes of each? 5. How are JSP scriptlets, declarations, and expressions different from each other? Discuss with examples and also explain why using scriptlets is discouraged in modern applications. JSP Tags & Directives 6. Describe the usage and differences between JSP include directive (<%@ include %>) and jsp:include action tag. When should each be used? 7. How does the JSP lifecycle differ from the Servlet lifecycle? Discuss with a diagram explaining translation, compilation, initialization, execution, and cleanup stages. Spring & Hibernate 8. Explain Spring's Inversion of Control (IoC) and Dependency Injection (DI). How do they promote loose coupling in Java applications? Provide code examples using annotations like @Component, @Autowired. 9. Discuss the Hibernate ORM lifecycle. Explain the roles of Session, SessionFactory, and Transaction in CRUD operations. How is Hibernate integrated into a Spring application? 10. Design a mini application using Spring and Hibernate that performs CRUD operations on a Student entity. Explain how annotations are used to map the class to a database table and how Spring manages transactions.