When starting the spring-boot project (java -jar / path / to / war.war) .jsp files were not found.
Methods annotated with @ResponseBody work fine. The view resolver approaches the correct path to the JSP pages, but they were not found. This project has one configuration class and not web.xml.
Configuration class:
@Configuration @EnableAutoConfiguration @EnableWebMvc @ComponentScan (basePackages = "org.ghc.security.web") class ScMain extends WebMvcConfigurerAdapter {
controller
@Controller class Running { @RequestMapping ("/alive") // This works fine @ResponseBody String amIAlive () { "ALIVE!" } @RequestMapping ("/alive/page") // Path to page resolved, but file not found! ModelAndView amIAlivePage () { new ModelAndView("alivepage") } }
Error log
2013-11-25 09: 08: 28.714 ERROR 1549 --- [tp1945397783-20] org.apache.jasper.servlet.JspServlet: PWC6117: File "% 2FUsers% 2Fnode42% 2FDevelopment% 2Fmock-security-ui% 2Fbuild% 2Flibs % 2Fmock-security-ui-2.06-SNAPSHOT.war% 2FWEB-INF% 2Fjsp% 2Falivepage.jsp "not found
The path to the .war file in the log entry is correct, and the path in the military file (WEB-INF / jsp / alivepage.jsp) is correct. The answer is the same, whether it be Jetty or Tomcat (the above log was from Jetty). I also tried not to use the view recognizer by specifying one of them, as indicated above, or set the resolution of the view through the properties. I am completely confused because everything looks as if it works, except for this small detail. And the annotated @ResponseBody method in the controller works fine.
If anyone has any suggestions, I would certainly be grateful for the entry!
source share