0

tried adding servlet mapping in web.xml as shown below but unable to load the page.

Here is the directory structure for webapp|->html|->hello.jsp or hello.html (tried with both jsp and html)

Click here to see directory structure

web.xml file

<servlet>
    <servlet-name>hello</servlet-name>
    <jsp-file>/html/hello.jsp</jsp-file>
</servlet>
<servlet-mapping>
    <servlet-name>hello</servlet-name>
    <url-pattern>/hello</url-pattern>
</servlet-mapping>

tried with multiple path in jsp-file tag for example /webapp/html/hello.jsp but end up with ERROR: javax.servlet.ServletException: missing jspFile: This error at least tells servlet dispatcher is able to get the request /hello . but further its failing to load JSP or HTML page.

  • 1
    Assuming you have a `DispatcherServlet` and using xml configuration add a view controller with ``. See https://docs.spring.io/spring/docs/current/spring-framework-reference/htmlsingle/#mvc-config-view-controller. – M. Deinum May 19 '17 at 18:18
  • Checkout this link http://stackoverflow.com/questions/15479213/how-to-serve-html-files-with-spring – Dhiraj Ray May 20 '17 at 09:23

0 Answers0