I have my pom.xml :
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
Also added :
<packaging>war</packaging>
Added contextpath in application.properties :
server.servlet.context-path=/admin
The name of war is also admin.war
I have also extended SpringBootServletInitializer in main class .
I upgraded the project from Spring Boot version 1.5.9 to 2.6.6 . When 1.5.9 version was used the war was deployed successfully in external tomcat. Now it shows as No mapping found for context Path with version upgrade. I am using tomcat version 9.0.64 with spring 2.6.6
Try using in properties
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.