springboot入门之--helloworld

springboot入门
package com.student.test;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;

@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})
public class TestApplication {

    public static void main(String[] args) {
        SpringApplication.run(TestApplication.class, args);
    }

}
package com.student.test.web;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloWorldController {
    @RequestMapping
    public String sayHello(){
        return "HelloWorld";
    }

}


项目截图:

运行结果:

问题总结:

@SpringBootApplication(exclude= {DataSourceAutoConfiguration.class})

括号里什么意思?

猜你喜欢

转载自blog.csdn.net/qq_41608559/article/details/107494447