[Spring Boot Reference Guide] reading notes one Getting Started

Source: Internet
Author: User

8. Introducing Spring Boot

Goals of Spring Boot:

    • Provide a radically faster and widely accessible getting started experience for all Spring development.
    • Be opinionated out of the box, but get out of the the-quickly as requirements start to diverge from the defaults.
    • Provide a range of non-functional features that is common to large classes of projects (e.g. embedded servers, security, Metrics, health checks, externalized configuration).
    • Absolutely no code generation and no requirement for XML configuration.

9. System Requirements

Spring boot integrates web containers for servlet 3.0+ such as Tomcat, Jetty, and so on.

Ten. Installing Spring Boot

Various installation methods for spring boot and Spring boot CLI

Developing your first Spring Boot application

1.

The spring-boot-starter-parent is a special starter that provides useful Maven defaults. It also provides a dependency-management sections so, can omit version tags for "blessed" dependencies.

Spring-boot-starter-parent provides the required dependencies, and can omit dependent versions.

Spring-boot-starter-web can be used to generate web programs, with Tomcat and so on.

2. Code:

1Import org.springframework.boot.*;2Import org.springframework.boot.autoconfigure.*;3Import org.springframework.stereotype.*;4Import org.springframework.web.bind.annotation.*;5 6@RestController//Rest controller that renders the string directly and returns it to the caller7@EnableAutoConfiguration//Automatic Configuration8  Public classExample {9@RequestMapping ("/")//RoutingTen String Home () { One         return "Hello world!"; A     } -      Public Static voidMain (string[] args) throws Exception { -Springapplication.run (Example.class, args); the     } -}

Start with the following command

MVN Spring-boot:run

[Spring Boot Reference Guide] reading notes one Getting Started

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.