I've set a servlet with this pattern /*
but I get a 404 error even to get the index.jsp file, I thougt that /*
matches with any pattern ,the code is correct because it works with *.html
web.xml
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>main</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>main</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
</web-app>
and this controller
package com.tutorial.ejemplospring.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class MainController {
@RequestMapping("/main.html")
public ModelAndView mainPage() {
return new ModelAndView("main");
}
@RequestMapping("/second.html")
public ModelAndView secondPage() {
return new ModelAndView("second");
}
}