I ran into the same problem, and with some help from @tadtab's answer, I was able to find a solution for the same problem in my project.
Steps:
1-> Follow the steps mentioned in @tadtab answers.
2-> Right-click on project-> Click Properties-> Find Deployment Assembly.
3-> Search if your folder exists on the screen. (If not, add it).
4-> On the screen, you will find the βDeployment Pathβ column corresponding to your source folder. Copy this path. In my case it was / views.
5-> Thus, in principle, in the setPrefix () method , we should have a path during deployment. Previously, I just used / views in the setPrefix () method , so I got the same error. But after that everything worked.
@Bean public ViewResolver viewResolver() { InternalResourceViewResolver resolver = new InternalResourceViewResolver(); resolver.setPrefix("/WEB-INF/classes/"); resolver.setSuffix(".jsp"); resolver.setExposeContextBeansAsAttributes(true); return resolver; }
The same should apply to the XML configuration.
source share