No mapping found for HTTP request with URI[] in DispatcherServlet with name 'action'
Bonsoir,
Je débute avec Spring,JSP,MVC et j'ai une erreur que je n'arrive pas à comprendre.
L'erreur est la suivante:
Citation:
No mapping found for HTTP request with URI [/GestionProduitSpringHibernateSybaway/index.aspx] in DispatcherServlet with name 'action'
Pouvez-vous m'éclairez sur ce sujet?
Mon Controleur:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| package controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import services.ProduitMetier;
@Controller
public class ProduitController {
@Autowired
ProduitMetier services;
@RequestMapping(value="/index")
public String pageIndex(){
return "produit";
}
} |
Web.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>ApplicationSpringHibernate</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring-beans.xml</param-value>
</context-param>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/servlet-config.xml</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.aspx</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>default.aspx</welcome-file>
</welcome-file-list>
</web-app> |
servlet-config.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:sec="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/beans
<a href="http://www.springframework.org/schema/beans/spring-beans-2.5.xsd" target="_blank">http://www.springframework.org/schem...-beans-2.5.xsd</a>
<a href="http://www.springframework.org/schema/context" target="_blank">http://www.springframework.org/schema/context</a>
<a href="http://www.springframework.org/schema/context/spring-context-2.5.xsd" target="_blank">http://www.springframework.org/schem...ontext-2.5.xsd</a>
<a href="http://www.springframework.org/schema/security" target="_blank">http://www.springframework.org/schema/security</a>
http://www.springframework.org/schema/security/spring-security-2.0.xsd">
<context:component-scan base-package="controller"/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/Pages/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans> |
Merci de m'éclairer à ce sujet, je vous en remercie d'avance.