使用jetty容器
This commit is contained in:
12
pom.xml
12
pom.xml
@@ -23,6 +23,18 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<!-- tomcat加载优先级高于jetty,若不加排除,则仍然加载tomcat -->
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- 使用 Jetty 容器 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jetty</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -14,7 +14,7 @@ public class DemoApplication {
|
||||
SpringApplication.run(DemoApplication.class, args);
|
||||
}
|
||||
|
||||
@RequestMapping("/{content}")
|
||||
@RequestMapping("/print/{content}")
|
||||
public String helloWorld(@PathVariable(name = "content", required = false) String content) {
|
||||
return "hello , " + content;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user