EN
Spring Boot 3 - "Whitelabel Error Page" getting in new project
1 answers
6 points
Any Idea why new Spring Boot 3 project return "Whitelabel Error Page" when I open http://localhost:8080 in the web browser?

1 answer
3 points
It looks like you don't have defined mappings.
e.g. src/main/java/com/example/demo/MainController.java
file:
xxxxxxxxxx
1
package com.example.demo;
2
3
import org.springframework.stereotype.Controller;
4
import org.springframework.web.bind.annotation.RequestBody;
5
import org.springframework.web.bind.annotation.RequestMapping;
6
import org.springframework.web.bind.annotation.RequestMethod;
7
import org.springframework.web.bind.annotation.ResponseBody;
8
9
10
public class MainController {
11
12
(
13
value = "/",
14
method = RequestMethod.GET
15
)
16
17
public String index() {
18
return "Hi There!";
19
}
20
}
0 commentsShow commentsAdd comment