Creating your first Spring Boot launch class

The following class explains how to create a simple Spring Boot launch class. It uses the static run method from the SpringApplication class, as shown in the following code snippet:

    package com.mastering.spring.springboot; 
import org.springframework.boot.SpringApplication;
import org.springframework.boot.
autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
@SpringBootApplication public class Application {
public static void main(String[] args)
{
ApplicationContext ctx = SpringApplication.run
(Application.class,args);
}
}

The preceding code is a simple Java main method executing the static run method on the SpringApplication class.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset