1. 程式人生 > >spring boot系列教程一

spring boot系列教程一

1.spring boot簡介

Spring Boot 的優點快速開發,特別適合構建微服務系統,另外給我們封裝了各種經常使用的套件,比如mybatis、hibernate、redis、mongodb等。

2.spring Hello World(maven方式)

<parent>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-parent</artifactId>
      <version>1.5.2.RELEASE</version>
  </parent>	

  <dependencies>
    <dependency>
         <groupId>org.springframework.boot</groupId>
         <artifactId>spring-boot-starter-web</artifactId>
     </dependency>
  </dependencies>
  
  <build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
  </build>
@SpringBootApplication
@RestController
public class App 
{
    public static void main( String[] args )
    {
    	SpringApplication.run(App.class, args); 
    }
    
    @RequestMapping("/")
    String home() {
        return "Hello World!";
    }
}