1

My project Spring MVC. and i am novice.

I had a problem I could not run my project with HTML file. I had error 404 but there wasn't with jsp. I solved the problem with help second solution by link: How to map requests to HTML file in Spring MVC?

So, i have the DispatcherServlet and the JspServlet in web.xml. I uderstand the JspServlet handling my HTMl reqest and the DispatcherServlet handling all other.

My question: Is it normal that i have these two servlets, or I can make so that the DispatcherServlet handling and HTML and all the other?

my web.xml:

  <display-name>FirstSpringMVC</display-name>  
   <servlet>    
    <servlet-name>spring</servlet-name>    
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>    
    <load-on-startup>1</load-on-startup>      
</servlet>    
<servlet-mapping>    
    <servlet-name>spring</servlet-name>    
    <url-pattern>/</url-pattern>    
</servlet-mapping>    
<servlet>
    <servlet-name>htmlServlet</servlet-name>
    <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
    <load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>htmlServlet</servlet-name>
    <url-pattern>*.html</url-pattern>
</servlet-mapping>
Tarxan
  • 11
  • 2

0 Answers0