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:
package com.example.demo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class MainController {
@RequestMapping(
value = "/",
method = RequestMethod.GET
)
@ResponseBody
public String index() {
return "Hi There!";
}
}
0 comments
Add comment