使用函數(shù)式編程,在 get 請求返回404
查了小伙伴的問題,總結(jié) 總算解決了。get 成功。
解決方式,就是修改了pom 文件。
我的pom文件如下:
<?xml?version="1.0"?encoding="UTF-8"?> <project?xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"?xmlns="http://maven.apache.org/POM/4.0.0" ?????????xsi:schemaLocation="http://maven.apache.org/POM/4.0.0?https://maven.apache.org/xsd/maven-4.0.0.xsd"> ????<modelVersion>4.0.0</modelVersion> ????<parent> ????????<groupId>org.springframework.boot</groupId> ????????<artifactId>spring-boot-starter-parent</artifactId> ????????<version>2.2.6.RELEASE</version> ????????<relativePath/>?<!--?lookup?parent?from?repository?--> ????</parent> ????<groupId>com.imooc</groupId> ????<artifactId>first-app-demo</artifactId> ????<version>0.0.1-SNAPSHOT</version> ????<packaging>jar</packaging> ????<name>first-app-demo</name> ????<description>Demo?project?for?Spring?Boot</description> ????<properties> ????????<java.version>1.8</java.version> ????</properties> ????<dependencies> ????????<!--<dependency>--> ????????<!--<groupId>org.springframework.boot</groupId>--> ????????<!--<artifactId>spring-boot-starter-web</artifactId>--> ????????<!--</dependency>--> <!--配置使用?jetty容器--> ????????<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> ????????<!--<dependency>--> ????????????<!--<groupId>org.springframework.boot</groupId>--> ????????????<!--<artifactId>spring-boot-starter-jetty</artifactId>--> ????????<!--</dependency>--> ????????<dependency> ????????????<groupId>org.springframework.boot</groupId> ????????????<artifactId>spring-boot-starter-webflux</artifactId> ????????</dependency> ????????<!--<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-test</artifactId> ????????????<scope>test</scope> ????????????<exclusions> ????????????????<exclusion> ????????????????????<groupId>org.junit.vintage</groupId> ????????????????????<artifactId>junit-vintage-engine</artifactId> ????????????????</exclusion> ????????????</exclusions> ????????</dependency> ????????<dependency> ????????????<groupId>io.projectreactor</groupId> ????????????<artifactId>reactor-test</artifactId> ????????????<scope>test</scope> ????????</dependency> ????</dependencies> ????<build> ????????<plugins> ????????????<plugin> ????????????????<groupId>org.springframework.boot</groupId> ????????????????<artifactId>spring-boot-maven-plugin</artifactId> ????????????</plugin> ????????</plugins> ????</build> </project>
2020-04-27
404錯(cuò)誤么?那就是找不到你訪問的頁面啊. 你怎么解決的?