QuestionBank 1to6
QuestionBank 1to6
QuestionBank 1to6
1) What is JDBC?
7) What is Maven & POM.xml file, write example of POM file to use MySQL Connector.
Assignment 2 : Servlet
---------------------------------------------------------
7. What is a servlet?
12. How do you add a project to a web server and run the first servlet?
Assignment 3 : JSP
-----------------------------------------------------------------------
1) Explain the architecture of JSP) How does it compare to servlets in terms of request handling?
2) Describe the role of JSP in a web application and how it interacts with other components such as
servlets and databases.
3) Illustrate the lifecycle of a JSP page with a detailed explanation of each phase.
4) What are the different methods involved in the lifecycle of a JSP page? Explain each method with its
purpose.
5) What are directive tags in JSP? List and explain the three main types of directive tags.
6) How does the `<%@ page %>` directive influence the behavior of a JSP page? Provide examples.
7) What is a scriptlet in JSP? How is it different from an expression? Provide an example of each.
8) Discuss the scope of variables declared inside a scriptlet. How does it affect the JSP page?
9) Explain the purpose of expressions in JSP) How are they evaluated and outputted on the client side?
10) Write a JSP page using expressions to calculate and display the sum of two numbers.
11) What is a declarative tag in JSP? How is it used to define methods and variables? Provide an example.
12) Discuss the scope and lifecycle of methods and variables defined using declarative tags in JSP.
13) List and explain the various implicit objects available in JSP) How do they facilitate web
development?
14) Write a JSP page demonstrating the use of at least three different implicit objects.
15) What are action tags in JSP? Describe their purpose and usage with examples.
16) Explain the `<jsp:include>` and `<jsp:forward>` action tags. How do they differ in functionality?
18) Provide examples of using JSTL core tags for iteration and conditional operations
19) What is Expression Language (EL) in JSP? How does it enhance the readability and maintainability of
JSP pages?
20) Write a JSP page that demonstrates the use of EL to access and display data from request and session
attributes
Q4 : Consider the below class, DataMembers and create a hibernate mapping file.
Q7 : Consider the below class, DataMembers and implement java based configuration.
custmobile etc.
Q8 : What is HQL ? Explain the usage of HQL in hibernate.
Q6 : What is Inversion of Control (IoC) in the context of the Spring Framework, and howdoes it
Q7 : What is Spring IOC Container? Explain the role of IoC container in spring application.
Question Bank
Spring Core
Spring is a comprehensive framework for Java-based enterprise applications, providing support for
dependency injection, aspect-oriented programming, transaction management, and more.
DI is a design pattern that allows the inversion of control, where the framework handles object creation
and dependencies.
IoC is a principle where the control of object creation and management is transferred from the
application code to the Spring framework.
Singleton.
ApplicationContext is the Spring IoC container that manages beans and their dependencies.
@Configuration indicates that a class contains bean definitions for the Spring IoC container.
AOP is a programming paradigm that allows separation of cross-cutting concerns (e.g., logging,
transactions).
17. What is a JoinPoint in AOP?
A JoinPoint is a point in the program execution, such as a method execution or object creation.
Advice is the action taken at a JoinPoint, such as before, after, or around a method execution.
BeanPostProcessor is an interface that allows custom logic before and after Spring bean initialization.
@Qualifier is used to resolve ambiguity when multiple beans of the same type exist.
Spring Boot
Spring Boot simplifies Spring application development by providing defaults and auto-configuration.
Auto-configuration automatically configures Spring beans based on the classpath and other settings.
Tomcat.
30. How can you change the embedded server in Spring Boot?
By excluding the Tomcat dependency and adding a different server, like Jetty or Undertow.
A starter is a set of dependencies to include commonly used libraries (e.g., spring-boot-starter-web for
web applications).
Actuator provides production-ready features like monitoring and management of a Spring Boot
application.
Port 8080.
38. How can you change the default port in Spring Boot?
@Value is used to inject values from properties files into Spring beans.
spring-boot-devtools provides features for developer productivity, like automatic restarts and live
reloads.
44. What is Spring Boot's JPA starter?
It is a starter for configuring Spring Data JPA with Hibernate as the default ORM.
The parent provides common configurations and dependency management for Spring Boot applications.
It enables Spring Boot’s auto-configuration feature to configure Spring beans automatically based on
classpath contents.
Q.1 Objective Type Questions - (State, Define, List, etc)
1. State the directive used to import classes, interfaces, or packages in a JSP page.
B) Explain the Spring IoC Container and its role in Spring applications (6)
B) What are Spring's Stereotype Annotations, and how do they help in component
scanning?
Q.5 Answer the following questions.
A) What are the JSP lifecycle phases?
B) What is RowSet interface and explain its types?
B) What is Hibernate and how does it simplify database interactions in Java applications?
B) Explain how Spring Boot manages external configuration. What are the different ways
to provide configuration to a Spring Boot application?