Skip to content
Advertisement

Why do I always get Whitelabel Error Page with status “404” while running a simple Spring Boot Application

My Controller

JavaScript

My JSP (welcome.jsp) inside /WEB-INF/jsp (parent folder is WebContent)

JavaScript

My pom.xml

JavaScript

My App Initializer

JavaScript

I even added thymeleaf dependency to my pom. It still didn’t work. When ever I hit localhost:8080/hello or /indexPage or /indexPageWithModel it always says

Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Wed Sep 21 21:34:18 EDT 2016 There was an unexpected error (type=Not Found, status=404). ]/WEB-INF/jsp/welcome.jsp

My application.properties

JavaScript

Please help me. Thanks!

Advertisement

Answer

Figured it out myself.

When I converted my dynamic webproject into maven project it did not create the folder structure this way

src/main/java

and

src/main/resources

and

src/main/webapp

I manually created myself and moved the jsp files from WebContent/WEB-INF/jsp to src/main/webapp/WEB-INF/jsp and modified the Java build path in the project properties.

Then I restarted the embedded tomcat and tried it again. It worked.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement