No mapping found for HTTP request with URI [/***] in DispatcherServlet with name 'dispatcherservlet ',
I believe that many beginners of Springboot, like me, have encountered the above prompt. Obviously, the path is correct, but they cannot find the correct page and 404, which has plagued me for a long time, I cannot solve the problem either. Baidu also rarely answered the question reasonably, because everything was normal in the past, which made me suspect that it was an idea problem, I have also re-installed and created many projects to experiment. This greatly delays my graduation design. In this way, when can I graduate.
One day, when I came back from the company with exhaustion and sat in front of the computer, I suddenly remembered some situations in the company. Then I looked at my project and found that, my target (the maven project is taget, And the gradle project is out), it seems that the information is not very complete, and my template is missing, and the xml file I made by mybaits is not scientific, so I am also Baidu, and I am also wondering why a good project does not generate a correct target.
Under constant pursuit, I recently solved this problem, mainly the metadata of pom. xml. Add the following after the dependencies label because it determines what the target is packaged.
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/**.*</include>
</includes>
</resource>
<resource>
<directory>src/main/java</directory>
<includes>
<include>**/*.xml</include>
</includes>
</resource>
</resources>
</build>
If you have a good job introduction, you can add me 1471914707, or you can enjoy it.