2 followers Follow

WARNING: No mapping found for HTTP request with URI

Hi Team,

I'm new in the Spring world and I'm building my first HelloWorld, but things are not working well, would someone help me?

This is my

package com.managementtool7ul.controller;

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

public class Login {

public ModelAndView login() {
return new ModelAndView("index");

My managementtool7ul.xml

<beans xmlns=""

<context:component-scan base-package="com.managementtool7ul.controller" />

<!-- <mvc:default-servlet-handler/> -->

<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/" />
<property name="suffix" value=".jsp" />


My web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="" xmlns="" xsi:schemaLocation="" version="3.0">

This is the log:

Jul 14, 2017 2:44:49 PM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/managementtool7ul/] in DispatcherServlet with name 'managementtool7ul'
Jul 14, 2017 2:45:07 PM org.springframework.web.servlet.PageNotFound noHandlerFound
WARNING: No mapping found for HTTP request with URI [/managementtool7ul/welcome.jsp] in DispatcherServlet with name 'managementtool7ul'

The files structure:

Let me know if anything else is needed.

Leandro Takeda

Please sign in to leave a comment.



Quick question, is there a reason or requirement for using XML based configuration for Spring?  If you're new to Spring, I would highly recommend you start with Spring Boot.  It takes care of the basic setup and plumbing and ensures that it's correct, so you as a developer can just focus on writing your application.

If you absolutely need to continue with an XML based app, bump the log level to DEBUG for `org.springframework.web` and attach a complete set of application logs here.

Daniel Mikusa 1 vote

Hi Daniel, thanks for your comments. I fixed it, my web.xml was wrong.

I changed the URL pattern from: <url-pattern>*.jsp</url-pattern> to: <url-pattern>/</url-pattern> and it worked.

Also, I didn't want to use Spring Boot because, for me, that is starting, it looks like I will not see what really Spring works. I like to see how things works and not just see that works.


Leandro Takeda 0 votes

Good, yes it's important to get the DispatcherServlet setup as the default servlet.  Glad you were able to get it working!

I completely understand what you're doing as a learning exercise as well.  You're right, it's nice to build up as you're learning.  I would also suggest Spring Boot as a top-down learning tool.  It is essentially the accumulated knowledge from a lot of great engineers on how to wire up a Spring based application so it makes a really good example.

Taking a basic Spring Boot application and drilling down into the configuration that it sets up for you allows you to see how one would ideally setup a Spring app.  You can see what's happening by looking at the debug logs (set `--debug` flag) and the auto configuration output.  Using STS, you can also easily drill down to see how things work.  For example, you can command (Mac) / ctrl (Windows) click on an annotation like `@SpringBootApplication` to see how that enables AutoConfiguration & ComponentScan for you.  You can also go to Navigate -> Open Type... and enter `*AutoConfiguration` to easily find the various auto configuration classes which setup your app.  Ex: WebMvcAutoConfiguration will show you how web-mvc is configured.

Hope that helps!

Daniel Mikusa 0 votes