Tag Archives: There was an unexpected error

springboot jsp: There was an unexpected error (type=Not Found, status=404). No message available

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

Today, I encountered a very wordless bug. When I visited it, I found that this path did not find the file. The main reason is that springboot uses the template with HTML suffix by default instead of JSP. Therefore, after adding the dependency package and startup mode, I need to add these two sentences to the configuration file.

spring.mvc.view.prefix=/
spring.mvc.view.suffix=.jsp

When suffix suffix is added, the file can be found according to the path, but this error will occur

There was an unexpected error (type=Not Found, status=404). / #
ǰ׺��j��jsp/user- list.jsp

Then add the prefix and suffix together and you can access them.

But the most pit is coming!!!

Yesterday, I configured the integrated JSP mode, and it can be accessed normally. Today, I opened the computer access program, but it didn’t work. I’ve been looking at it. It should be the problem of path. Then I looked at the path of the controller, the name of the template, and the configuration file,

spring.mvc.view .prefix=/
spring.mvc.view .suffix=.jsp

After looking for it for a long time, I didn’t believe it. I first repeated the suffix, received it, didn’t copy it, and then restarted the scope of the project. The error report became a garbled error report. Then I changed the prefix and restarted the access. It was OK. I felt that the most pitiful thing was this. I found the bug for more than an hour, just because springboot couldn’t reload the configuration that had been written File?? It’s strange, but it’s always done. I’ll find out the reason later.