Spring DispatcherServlet: no se ha encontrado ninguna asignación para la solicitud HTTP
Tengo un problema al implementar una página muy simple usando spring mvc 3.2.4.RELEASE.
Mi controlador se ve así:
@Transactional
@Controller
public class MembersDetailsController {
@Autowired
private MemberService memberService;
@RequestMapping(value = "/member/{name}", method = RequestMethod.GET)
public String displayMember(@PathVariable String name) {
System.out.println(name);
return "member";
}
@RequestMapping(value = "/member", method = RequestMethod.GET)
public String displayMember() {
System.out.println("Empty");
return "member";
}
}
Cuando llamo
http://127.0.0.1:8080/member
El método respectivo se está ejecutando como se desea. Sin embargo, cuando llamo
http://127.0.0.1:8080/member/test
o
http://127.0.0.1:8080/member/test/
Me sale un 404 con la salida de registro:
WARN org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/member/test] in DispatcherServlet with name 'mvc-dispatcher'
Lo que realmente estamos deseados es que un registro anterior dice:
INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/member/{name}],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String
INFO org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Mapped "{[/member],methods=[GET],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public java.lang.String
Lo que significa que la asignación debe ser correcta en la medida en que entiendo esto.
Este es mi web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!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>Mitgliederdatenbank</display-name>
<!--Configuration-->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-security.xml, /WEB-INF/applicationContext.xml</param-value>
</context-param>
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
<init-param>
<param-name>sessionFactoryBeanName</param-name>
<param-value>hibernateSessionFactory</param-value>
</init-param>
</filter>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<!--Spring Security Filter-->
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<!--Context Loader-->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<!-- Servlets -->
<servlet>
<servlet-name>springGwtRemoteServiceServlet</servlet-name>
<servlet-class>org.spring4gwt.server.SpringGwtRemoteServiceServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>mvc-dispatcher</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Mapping -->
<servlet-mapping>
<servlet-name>springGwtRemoteServiceServlet</servlet-name>
<url-pattern>/ui/springGwtServices/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/welcome</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/logout</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/loginfailed</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>mvc-dispatcher</servlet-name>
<url-pattern>/member/*</url-pattern>
</servlet-mapping>
<!-- Default page to serve -->
<welcome-file-list>
<welcome-file>/login</welcome-file>
</welcome-file-list>
</web-app>
¿Podría alguien por favor darme una pista de lo que salió mal aquí?