Tag Archives: SpringBoot



Spring is a very popular Java based framework for building web and enterprise applications. Unlike many other frameworks which focuses on only one area, Spring framework provides a wide variety of features addressing the modern business needs through its portfolio projects. Spring framework provides flexibility to configure the beans in multiple ways such as XML, Annotations, and JavaConfig. With the number of features increased the complexity also gets increases and configuring Spring applications becomes tedious and error-prone. Spring team created SpringBoot to address the complexity of configuration. Explore this article and know more about SpringBoot.

Overview of Spring framework

If you are a Java developer, then there is a high chance that you might have heard about Spring framework and probably have used it in your projects. Spring framework was initially created as a Dependency Injection container but we all know it is much more than that.

Spring is very popular because of various reasons

  • Spring’s dependency injection approach encourages the writing testable code.
  • Spring simplifies integration with other Java frameworks like JPA/Hibernate ORM, Struts/JSF, and other web frameworks
  • State of the art Web MVC framework for building web applications

Along with Spring framework there are many other Spring sister projects which helps to build applications addressing modern business needs:


Spring Data : Simplifies data access from relational and NoSQL data stores.

Spring Batch : Provides powerful batch processing framework.

Spring Security : Robust security framework to secure applications.

Spring Social : Supports integration with social networking sites such as Facebook, Twitter, LinkedIn, GitHub, and much more.

Spring Integration : An implementation of Enterprise Integration Patterns to facilitate integration with other enterprise applications using lightweight messaging and declarative adapters.

There are many other interesting projects addressing various other modern application development needs.

In the initial days, Spring framework has provided XML based approach for configuring beans. Later Spring has introduced XML based DSLs, Annotations, and JavaConfig based approaches for configuring beans.

A quick taste of SpringBoot

Welcome to SpringBoot! SpringBoot do what exactly you are looking for. It will do things automatically for the user and allows them to override the defaults if they want to.

Instead of explaining in theory let’s see by example.

Step 1: Create a Maven based SpringBoot Project

Create a Maven project and configure the dependencies as follows:


<?xml version=”1.0″ encoding=”UTF-8″?>

<project xmlns=”http://maven.apache.org/POM/4.0.0″














































Wow our pom.xml suddenly become so small!!.

Step 2: Configure datasource/JPA properties in application.properties in src/main/resources as follows.








Step 3: Create a JPA Entity and Spring Data JPA Repository Interface for the entity.

Create User.java, UserRepository.java and HomeController.java same as in springmvc-jpa-demo application.

Step 4: Create Thymeleaf view to show list of users

Copy /WEB-INF/views/index.html that we created in springmvc-jpa-demo application into src/-main/resources/templates folder in our new project.

Step 5: Create SpringBoot EntryPoint Class

Create a Java class Application.java with main method as follows:


public class Application


public static void main(String[] args)


SpringApplication.run(Application.class, args);



Now run Application.java as a Java Application and point your browser to