Skip to main content

Spring Boot


1) What is Spring Boot?
Spring Boot is a Spring module which provides RAD (Rapid Application Development) feature to Spring framework.
It is used to create stand alone spring based application that you can just run because it needs very little spring configuration.
For more information click here.
2) What are the advantages of Spring Boot?
o    Create stand-alone Spring applications that can be started using java -jar.
o    Embed Tomcat, Jetty or Undertow directly. You don't need to deploy WAR files.
o    It provides opinionated 'starter' POMs to simplify your Maven configuration.
o    It automatically configure Spring whenever possible.
For more information click here.
3) What are the features of Spring Boot?
o    Web Development
o    SpringApplication
o    Application events and listeners
o    Admin features
For more information click here.
4) How to create Spring Boot application using Maven?
There are multiple approaches to create Spring Boot project. We can use any of the following approach to create application.
o    Spring Maven Project
o    Spring Starter Project Wizard
o    Spring Initializr
o    Spring Boot CLI
For more information click here.
5) How to create Spring Boot project using Spring Initializer?
It is a web tool which is provided by Spring on official site. You can create Spring Boot project by providing project details.
For more information click here.
6) How to create Spring Boot project using boot CLI?
It is a tool which you can download from the official site of Spring Framework. Here, we are explaining steps.
Download the CLI tool from official site and For more information click here.
7) How to create simple Spring Boot application?
To create an application. We are using STS (Spring Tool Suite) IDE and it includes the various steps that are explaining in steps.
For more information click here.
8) What are the Spring Boot Annotations?
The @RestController is a stereotype annotation. It adds @Controller and @ResponseBody annotations to the class. We need to import org.springframework.web.bind.annotation package in our file, in order to implement it.
For more information click here.
9) What is Spring Boot dependency management?
Spring Boot manages dependencies and configuration automatically. You don't need to specify version for any of that dependencies.
Spring Boot upgrades all dependencies automatically when you upgrade Spring Boot.
For more information click here.
10) What are the Spring Boot properties?
Spring Boot provides various properties which can be specified inside our project's application.properties file. These properties have default values and you can set that inside the properties file. Properties are used to set values like: server-port number, database connection configuration etc.
For more information click here.
11) What are the Spring Boot Starters?
Starters are a set of convenient dependency descriptors which we can include in our application.
Spring Boot provides built-in starters which makes development easier and rapid. For example, if we want to get started using Spring and JPA for database access, just include the spring-boot-starter-data-jpa dependency in your project.
For more information click here.
12) What is Spring Boot Actuator?
Spring Boot provides actuator to monitor and manage our application. Actuator is a tool which has HTTP endpoints. when application is pushed to production, you can choose to manage and monitor your application using HTTP endpoints.
For more information click here.
13) What is thymeleaf?
It is a server side Java template engine for web application. It's main goal is to bring elegant natural templates to your web application.
It can be integrate with Spring Framework and ideal for HTML5 Java web applications.
For more information click here.
14) How to use thymeleaf?
In order to use Thymeleaf we must add it into our pom.xml file like:
1.    <dependency>    
2.    <groupId>org.springframework.boot</groupId>    
3.    <artifactId>spring-boot-starter-thymeleaf</artifactId>    
4.    </dependency>    
For more information click here.
15) How to connect Spring Boot to the database using JPA?
Spring Boot provides spring-boot-starter-data-jpa starter to connect Spring application with relational database efficiently. You can use it into project POM (Project Object Model) file.
For more information click here.
16) How to connect Spring Boot application to database using JDBC?
Spring Boot provides starter and libraries for connecting to our application with JDBC. Here, we are creating an application which connects with Mysql database. It includes the following steps to create and setup JDBC with Spring Boot.
For more information click here.
17) What is @RestController annotation in Spring Boot?
The @RestController is a stereotype annotation. It adds @Controller and @ResponseBody annotations to the class. We need to import org.springframework.web.bind.annotation package in our file, in order to implement it.
For more information click here.
18) What is @RequestMapping annotation in Spring Boot?
The @RequestMapping annotation is used to provide routing information. It tells to the Spring that any HTTP request should map to the corresponding method. We need to import org.springframework.web.annotation package in our file.
For more information click here.
19) How to create Spring Boot application using Spring Starter Project Wizard?
There is one more way to create Spring Boot project in STS (Spring Tool Suite). Creating project by using IDE is always a convenient way. Follow the following steps in order to create a Spring Boot Application by using this wizard.
For more information click here.
20) Spring Vs Spring Boot?
Spring is a web application framework based on Java. It provides tools and libraries to create a complete cutomized web application.
Wheras Spring Boot is a spring module which is used to create spring application project that can just run.

Comments

Popular posts from this blog

Mockito interview Questions

1.       Question 1. What Is Mockito? Answer : Mockito allows creation of mock object for the purpose of Test Driven Development and Behavior Driven development. Unlike creating actual object, Mockito allows creation of fake object (external dependencies) which allows it to give consistent results to a given invocation. 2.       Question 2. Why Do We Need Mockito? What Are The Advantages? Answer : Mockito differentiates itself from the other testing framework by removing the expectation beforehand. So, by doing this, it reduces the coupling. Most of the testing framework works on the "expect-run-verify". Mockito allows it to make it "run-verify" framework. Mockito also provides annotation which allows to reduce the boilerplate code. 3.       Question 3. Can You Explain A Mockito Framework? Answer : In Mockito, you always check a particular class. The dependency in that class is injected using m...

JAVA Expert Interview Questions Answers 2017

Java Basics ::  Interview Questions and Answers Home  »  Interview Questions  »  Technical Interview  »  Java Basics  » Interview Questions 1.     What is the difference between a constructor and a method? A constructor is a member function of a class that is used to create objects of that class. It has the same name as the class itself, has no return type, and is invoked using the new operator. A method is an ordinary member function of a class. It has its own name, a return type (which may be void), and is invoked using the dot operator. 2.     What is the purpose of garbage collection in Java, and when is it used? The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused. A Java object is subject to garbage collection when it becomes unreachable to the program in which it is used. 3.  ...

Java Example Program to Convert List to Set

import java.util.ArrayList; import java.util.HashSet; import java.util.Set; public class ListToSet {  /**   * @author Amarjit Kumar   * @category interview questions   *   * Description: Convert List to set in java with example program   *   */  public static void main(String[] args) {   ArrayList<String> arrList= new ArrayList<>();   arrList.add("Java");   arrList.add("Java");   arrList.add("List to String");   arrList.add("Example Program");   Set<String> strSet = new HashSet<String>(arrList);   System.out.println(strSet);   System.out.println(arrList);  } } /*  * Java program to convert list to set. Convert ArrayList of string to HashSet  * in java example program How to convert List to Set in java Set<String> strSet  * = new HashSet<String>(arrList); HashSet having a constructor which will take  * list as an ar...