Tick New spring boot project: web configuration and two
Notes on configuration does not take effect:
<dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> </dependency>
In the above code configuration file pom.xml
Then update the dependencies maven reimport
Invalidate and restart to restart at
Code:
@RestController @SpringBootApplication(exclude = DataSourceAutoConfiguration.class) public class DemoSApplication { @RequestMapping(value = "/hello") public String getString(){return "Hello World!";} public static void main(String[] args) { SpringApplication.run(DemoSApplication.class, args); } }
Run successfully:
Successful visit: