"Welcome To Ashok IT" "Spring Boot and MicroServices" Topic : Spring Boot MVC Date : 07/05/2025 (Session - 41) _____________________________________________________________________________________________________________________________ Interview Questions =================== 1) what is advantage of using Spring Boot over spring Framework? 2) What are features of Spring Boot Application? 3) Importance of Starters in Spring Boot Application? 4) What is the Auto Configuration in Spring Boot and how it will works? 5) What is importance of @SpringBootApplication Annotations? 6) What do you mean Component Scan in Spring? 7) What are different annotations used in spring boot application? * Stero types Annotations * @SpringBootApplication * @ConfigurationProperties * @Import,@ImportResource,@PropertiesResources,@Qualifier,@Primary,@Profile 8) Different between ORM Frameworks & Spring Data JPA Module? 9) Differences between CurdRepoistory & JPARepoistory 10) What are different sequence generators in Spring Data JPA (Or) ORM Frameworks? 11) Differents annotations used in Spring Data Development? * @Entity,@Table,@ID,@GeneratedValue,@SequenceGenerator,@Column,@Transient,@Query,@Transaction,@Procedure @OneTOone,@OneToMany,@ManyToOne,@JoinColumn etc., 12) What are different fetch Strategy are available in ORM Frameworks (or) Spring Data JPA? 13) What are different casadeTypes strategy are available in ORM Frameworks. 14) How are you executing Stored Procedure & Stored Functions in Spring JDBC Module & ORM Frameworks & Spring Data JPA? 15) How we are connecting multiple databases in Spring Boot Application? Today Session : =============== Spring MVC ========== * Spring MVC is part of Spring Framwork and Spring Boot MVC is part of Spring Boot Module. * Spring MVC & Spring Boot MVC Modules are helpful for developing "WebApplications" using Spring Framework. * The Application which can be available through out the globe such type of application called "Web Application". * Web Application is nothing but collection of WebPages. * Basically web pages are classified into two types 1) Static Webpage >>>>>>>>> The content of webpage will always fixed and common for every user. Ex: Gmail Login Page etc., Ex: Client Side Technologies (Html,Javascript,CSS,JQuery etc.,) 2) Dynamic Webpage >>>>>>>>> The content of webpage will be changed from one user to another user. Ex: Gmail Dashboard etc., Ex: Server Side Technologies (Servlet,JSP etc.,) * Inorder to execute the Static webpages (or) static webresource programs we required "Browser" Inorder to execute the dynamic webpages (or) Dynamic webresource programs we required "Web Servers/Application Servers" * Every Web Application will follows the "Client-Server" Architectural Model Protocal(http) Client(Browser) <-----------------------------------------------------------------> Server(Machine) request Client(Browser) -------------------------------------------------------------------> Server(Machine) response Client(Browser) <------------------------------------------------------------------- Server(Machine) * Protocal are nothing but set of rules & guidelines between the two parties for exchanging information and we have two types of protocals 1) Application Protocal : Application -to- Application Example : jdbc:oracle, jdbc:mysql etc., 2) Network Protocal : Exchanging the data between machine's through network. Example : SMTP,FTP,Telnet,http etc.., * Inorder to develop the WebApplication In Java Sunmicrosystem provided the initial Technologies i.e.,Servlets & JSP's. Servlet >>>>>>>>>>>>>>>>> Defining the Request Processing Logic 1) Collecting (or) Taking inputs from enduser. 2) Placing Business logic. 3) Communicating with database through Jdbc Technology. JSP(Java Server Pages) >>>>>>>>>>>>>> Recommended for Presenting the Data . * We can develop the Servlet Program in four ways 1) By Implementing javax.servlet.Servlet (or) jakarta.servlet.Servlet(I) 2) By extending javax.servlet.GenericServlet (or) jakarta.servlet.GenericServlet(AC) 3) By extending javax.servlet.http.HttpServlet (or) jakarta.servlet.http.HttpServlet(AC) 4) By using @WebServlet Annotation * Inorder to execute & Test WebApplication definetly we required Java based "WebServer/Application Server". Example: Tomcat,Jetty,Weblogic,JBOSS(Wildfly),WebSphere etc.., * By default Spring Boot Application will get three embedded Servers 1) Tomcat 2) Jetty 3) Undertow * Typically for every webapplication will have some common requirements such as 1) Validations 2) Exception Handling 3) Internationalization(I18N). * Inorder to implement the above common logic for an webapplication using servlet and JSP as programmer need to spend some time to define the logics and at same time creating and configuring the servlet will be takecare by programmer. * Inorder to overcome this problems we need to go for "Framework Softwares" developing the webapplications 1) Struts Framework from Apache Software >>>>>>>>>>>>> Outdated 2) Java Server Faces(JSF) from Mozarra >>>>>>>>>>>>> Outdated 3) Spring MVC from Spring Source >>>>>>>>>>>>> Currently some applications using market Technical Stack (or) Tech stack * Every Java Based framework Software will give you some ready made code which are commonly required for an projects which will reduce the burden for the programmers. * Every Java Based WebApplication Framework is developed by using one architectural design pattern i.e. MVC Design Pattern. * MVC Design pattern mainly involves three component's 1) M -> Model -----------------------> Java Class for communicating with Database 2) V -> View -----------------------> Presenting the data Ex:Jsp Pages 3) C -> Controller ---------------------> Request Processing Logic Ex: Servlet Program * Every Java Based Web Application Framework has given one predefined Controller as ready made class which contains common code required for Java based webapplication. Struts Framework <--------------------------------> ActionServlet <-------------------> Servlet JSF Framework <--------------------------------> FacesServlet <--------------------> Servlet Spring MVC Framework <-----------------------------> DispatcherServlet <---------------> Servlet +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++