WARNING: No mapping found for HTTP request with URI[] in DispatcherServlet with name []

Related searches

I'm really new to Spring framework and I'm struggling why I'm getting this warning. I have looked at the questions at StackOverflow and coderanch but it seems that I can't find my error. I even tried to watch a youtube Spring MVC tutorial twice and I'm doing the same thing as the Youtuber does but I'm still getting this error. I would really appreciate it if you guys could help me. I will put my codes below.

pom.xml

  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>com.telusko</groupId>
  <artifactId>DemoMVC2</artifactId>
  <packaging>war</packaging>
  <version>0.0.1-SNAPSHOT</version>
  <name>DemoMVC2 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>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>4.1.8.RELEASE</version>
        </dependency>

        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>4.1.8.RELEASE</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.1.36</version>
        </dependency>
        <dependency>
            <groupId>javax.servlet</groupId>
            <artifactId>jstl</artifactId>
            <version>1.2</version>
        </dependency>
  </dependencies>
  <build>
    <finalName>DemoMVC2</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_3.dtd" >

<web-app>
  <display-name>Archetype Created Web Application</display-name>

  <servlet>
        <servlet-name>telusko</servlet-name>
        <servlet-class>
            org.springframework.web.servlet.DispatcherServlet
        </servlet-class>
    </servlet>
    <servlet-mapping>
        <servlet-name>telusko</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>
</web-app>

telusko-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:ctx="http://www.springframework.org/schema/context"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/mvc
    http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context-2.5.xsd ">


    <mvc:annotation-driven/>
    <ctx:component-scan base-package="com.telusko"></ctx:component-scan>
</beans>

index.jsp

<html>
<body>
<form action="add">
    <input type="text" name="t1"></input><br>
    <input type="text" name="t2"></input><br>
    <input type="submit"></input>
</form>
</body>
</html>

addController.java

package com.telusko;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class addController {
    @RequestMapping("/add")
    public void add() {
        return "display.jsp";
    }
}

display.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

    I'm here

</body>
</html>

This is the servlet you created. You have created a telusko servlet on the DispatcherServlet class. And then you mapped it with /. When the application starts, it does not find a function mapped to /. So you will have to readjust your web.xml file

Debugging the Spring MVC 404 "No mapping found for HTTP , DispatcherServlet, which acts as the front controller, is responsible for In such a case, we'd see a warning message in the server logs: No mapping found for HTTP request with URI [/greetings] in DispatcherServlet with name 'mvc' [/WEB- INF/view/greeting.jsp] in DispatcherServlet with name 'mvc'� WARNING: No mapping found for HTTP request with URI [/] in DispatcherServlet with name 'SpringDispat . sangiehoonie kimmie. Greenhorn Posts: 7. posted 2 years ago.

return type : void

required type : String

AddController.java :

package com.telusko;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class addController {
    @RequestMapping("/add")
    public String add() {
        return "display.jsp";
    }
}

or else you can do this :

package com.telusko;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class addController {
    @RequestMapping("/add")
    public ModelAndView add() {
        return new ModelAndView("display.jsp");
    }
}

"No mapping found for HTTP request with URI[.] in , "No mapping found for HTTP request with URI[. all requests through a DispatcherServlet that you've registered with your AndroidManifest.xml:62: error: Error: No resource found that matches the given name (at 'value' with� Spring MVC - No mapping found for HTTP request with URI [/webstore/] in DispatcherServlet with name 'DefaultServlet' Tag: java , spring , spring-mvc I'm following along with the book "Spring MVC Beginner's Guide", and I'm running into what appear to be request mapping problems.

After two days I have finally decided to create a new project and start from new. I guess i had some configuration problems because after I created my new project everything worked smoothly but thanks for your answers.

No mapping found for HTTP request with URI[] in DispatherServlet , All your request will be served by your standard Spring MVC application which will serve all requests through a DispatcherServlet that you've� WARNING: No mapping found for HTTP request with URI [/XXX/welcome] in DispatcherServlet with name 'mvc-dispatcher' here is my configuration mvc-dispatcher-servlet.xml

Perfect solution to the problem of No mapping found for HTTP , Warning: No mapping found for HTTP request with URI [/myboss-web/js/jquery- 1.8.3.js] in Dispatcher Servlet with name'mvc-dispatcher'. Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServlet”? 33 Configure ViewResolver with Spring Boot and annotations gives No mapping found for HTTP request with URI error

Why does Spring MVC respond with a 404 and report “No mapping found for HTTP request with URI […] in DispatcherServlet”? 1 No mapping found for HTTP request with URI [/HelloWeb/] in DispatcherServlet with name 'HelloWeb'

No mapping found for HTTP request with URI [/CMS/admin] in DispatcherServlet with name 'cms' Problem running app under Tomcat v7 Spring annotation no handler found

Comments
  • thanks, I didn't really notice that. But that didn't solve my issue. I'm still getting 404 not found when I'm submitting to my form.
  • @noselessxXxXxX Is adding "/" in the <form action="/add"> solving the issue?
  • @NikNik nope it didn't work but thank you for trying.