I developed a simple Hello World Spring MVC Web Application using Spring Boot (Spring Initializr - start.spring.io). I chose the following options at Spring Initializr:
- Project: Maven
- Language: Java
- Spring Boot: 3.1.2
- Dependencies: Spring Web
Clicked on Generate to download the starter app, extracted it and added:
- helloWorld.html- this just diplays Hello World! (Please see below for the GitHub Repo URL)
- Controller Java Class with one action method tagged with @RequestMapping("/helloWorld") that returns "helloWorld.html" (Please see below for the GitHub Repo URL)
Issue: When I try to hit the action method from the browser using the following url I get "Whitelabel Error Page": http://localhost:8080/helloWorld
Can you please tell me what I am missing?
GitHub Repo: https://github.com/angunda/hello-world-spring-web-app
I tried issuing GET /localhost:8080/helloWorld in InteliJ's HttpClient and got 404 NOT FOUND error instead of the helloWorld.html file.
I also issued the request from chrome using http://localhost:8080/helloWorld, however, got Whitelabel Error Page instead of helloWorld.html page