Tuesday 15 February 2011

eclipse - No mapping found for HTTP request with URI 3 (resolved) -



eclipse - No mapping found for HTTP request with URI 3 (resolved) -

i have read many posts on issue without beingness able find solution problem. true started in java ee / maven / spring.

the error encounter like: "no mapping found http request uri" displayed in eclipse console when uri :

http://localhost:8080/collecte-cloudvoice/bonjour

i tried follow tutorial: http://rpouiller.developpez.com/tutoriels/spring/application-web-spring-hibernate/

here different parts of code:

porn.xml:

<project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>fr.conviviance.tools</groupid> <artifactid>collecte-cloudvoice</artifactid> <packaging>war</packaging> <version>0.0.1-snapshot</version> <name>collecte-cloudvoice maven webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupid>junit</groupid> <artifactid>junit</artifactid> <version>3.8.1</version> <scope>test</scope> </dependency> <dependency> <groupid>javax.servlet</groupid> <artifactid>servlet-api</artifactid> <version>2.5</version> <scope>compile</scope> </dependency> <dependency> <groupid>org.springframework</groupid> <artifactid>spring-webmvc</artifactid> <version>4.0.2.release</version> </dependency> </dependencies> <build> <finalname>collecte-cloudvoice</finalname> </build> </project>

web.xml:

<!doctype web-app public "-//sun microsystems, inc.//dtd web application 2.3//en" "http://java.sun.com/dtd/web-app_2_4.dtd" > <web-app> <context-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/dispatcher-servlet.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> <!-- declaration de la servlet de spring et de boy mapping --> <servlet> <servlet-name>servlet-dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <init-param> <param-name>contextconfiglocation</param-name> <param-value>/web-inf/dispatcher-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>servlet-dispatcher</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app>

dispatcher-servlet.xml:

<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:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <bean id="messagesource" class="org.springframework.context.support.reloadableresourcebundlemessagesource"> <property name="basename" value="classpath:messages" /> <property name="defaultencoding" value="iso-8859-1" /> </bean> <context:component-scan base-package="fr.conviviance.tools" /> <bean class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix"> <value>/vues/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> </beans>

bonjour.jsp:

<%@ page language="java" contenttype="text/html; charset=iso-8859-1" iselignored="false" pageencoding="iso-8859-1"%> <%@taglib uri="http://www.springframework.org/tags" prefix="spring"%> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <title><spring:message code="titre.bonjour"/> : ${personne}</title> </head> <body> <spring:message code="libelle.bonjour.lemonde" arguments="${personne}"/> </body> </html>

bonjourcontroler.java:

package fr.conviviance.tools; import org.springframework.stereotype.controller; import org.springframework.ui.modelmap; import org.springframework.web.bind.annotation.requestmapping; import org.springframework.web.bind.annotation.requestmethod; @controller @requestmapping("/bonjour") public class bonjourcontroller { @requestmapping(method = requestmethod.get) public string afficherbonjour(final modelmap pmodel) { pmodel.addattribute("personne", "regis"); homecoming "bonjour"; } }

le projet:

http://i59.servimg.com/u/f59/17/36/38/59/projet10.jpg

if start server in debug, can see next on console:

nov. 12, 2014 2:26:48 pm org.springframework.beans.factory.xml.xmlbeandefinitionreader loadbeandefinitions infos: loading xml bean definitions servletcontext resource [/web-inf/dispatcher-servlet.xml] nov. 12, 2014 2:26:48 pm org.springframework.web.servlet.mvc.annotation.defaultannotationhandlermapping registerhandler infos: mapped url path [/bonjour] onto handler 'bonjourcontroller' nov. 12, 2014 2:26:48 pm org.springframework.web.servlet.mvc.annotation.defaultannotationhandlermapping registerhandler infos: mapped url path [/bonjour.*] onto handler 'bonjourcontroller' nov. 12, 2014 2:26:48 pm org.springframework.web.servlet.mvc.annotation.defaultannotationhandlermapping registerhandler infos: mapped url path [/bonjour/] onto handler 'bonjourcontroller' nov. 12, 2014 2:26:48 pm org.springframework.web.servlet.dispatcherservlet initservletbean infos: frameworkservlet 'servlet-dispatcher': initialization completed in 320 ms

eclipse spring maven java-ee dispatcher

No comments:

Post a Comment