我用maven做教程https://spring.io/guides/gs/uploading-files/
我使用的所有代码都被复制了。
应用程序可以运行,但出现错误:
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. Tue Jun 30 17:24:02 CST 2015 There was an unexpected error (type=Not Found, status=404). No message available
我该如何解决?
最佳答案
确保您的主类位于其他类之上的根包中。
当您运行 Spring Boot 应用程序时(即使用 @SpringBootApplication 注解的类),Spring 将仅扫描您的主类包下的类。
com
+- APP
+- Application.java <--- your main class should be here, above your controller classes
|
+- model
| +- user.java
+- controller
+- UserController.java
关于spring - 此应用程序没有明确的/错误映射,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31134333/