Skip to content
Advertisement

Spring Boot jsp file not found Error 404 weird prefix

I am currently learning Spring/Spring Boot and I am trying to code a forgot password function. All my other functions, like login etc. are working as intended, but redirecting to an reset-password page does not work for some reason and gives me the following error, in which it looks for the jsp with a weird prefix.

There was an unexpected error (type=Not Found, status=404).

JSP file [/reset-password/WEB-INF/jsp/reset-password.jsp] not found

My folder structure

I generate links that look like so: http://localhost:8080/reset-password/{a-random-uuid}

reset-password.jsp

JavaScript

My reset-controller:

JavaScript

The Resetpasswordform

JavaScript

properties file

JavaScript

Finally my pom.xml

JavaScript

I am pretty sure my pom and controller are right, since I can’t see a difference between this controller and my other controllers.

Note: Password and Retype password are just custom constraints, that check, the size of the password and if the two passwords of the form math an such.

I think somewhere, the Viewcontroller messes up and puts the prefix in there. But I could not find out where that may come from. Others with the same problem didnt have jasper in their pom or the wrong folder structure, but I double checked those errors.

Advertisement

Answer

Try to change the following property to start with a /

JavaScript

This will allow spring to search into subfolders of your webapp/WEB-INF/jsp path.

Advertisement