No mapping found for HTTP request with URI [/spring_liu/hello.do] in DispatcherServlet with name 'SpringMVC'

控制台一直报No mapping found for HTTP request with URI [/spring_liu/hello.do] in DispatcherServlet with name ‘SpringMVC‘,最后发现是controller没有扫描到

造成的,我这边是xml没有添加组件扫描

<?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:jdbc="http://www.springframework.org/schema/jdbc"
    xmlns:jee="http://www.springframework.org/schema/jee"
    xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:util="http://www.springframework.org/schema/util"
    xmlns:jpa="http://www.springframework.org/schema/data/jpa"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
        http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
        http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd
        http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd
        http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd
        http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd">
    <!-- 组件扫描 -->
    <!-- base-package:根包 -->
    <context:component-scan
        base-package="cn.tedu.spring" />

</beans>

No mapping found for HTTP request with URI [/spring_liu/hello.do] in DispatcherServlet with name 'SpringMVC'

原文地址:https://www.cnblogs.com/package-java/p/10361887.html

时间: 2024-10-09 02:53:41

No mapping found for HTTP request with URI [/spring_liu/hello.do] in DispatcherServlet with name 'SpringMVC'的相关文章

No mapping found for HTTP request with URI [/login.do] in DispatcherServlet with name &#39;spring&#39;

No mapping found for HTTP request with URI [/account/login.do] in DispatcherServlet with name 'spring' 这个头大的问题啊  最终还是找到了解决方案: <!-- 启动SpringMVC的注解功能,它会自动注册HandlerMapping.HandlerAdapter.ExceptionResolver的相--> <mvc:annotation-driven /> 我们使用的jar不同

SpringMvc出现No mapping found for HTTP request with URI的终极解决办法

No mapping found for HTTP request with URI 出现这个问题的原因是在web.xml中配置错了,如: <servlet> <servlet-name>springMVCDispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init

[org.springframework.web.servlet.PageNotFound] -No mapping found for HTTP request with URI [/homework/js/jquery-1.7.2.min.js] in DispatcherServlet with name &#39;SpringMVC&#39;

先上解决方案:对于上面出现的问题,查看了很多相关的博客,论坛.最后实在Spring-mvc.xml这个配置文件里加入了如下两行: 1 <mvc:annotation-driven /> 2 <mvc:default-servlet-handler /> 问题描述: 由于项目需要Ajax,于是在jsp的head里加入了如下代码: 1 <script type="text/javascript" src="/homework/js/jquery-1.

java springmvc No mapping found for HTTP request with URI

最近,想写一个全文搜索的工具,想着就是用springMVC+lucene+tika来完成,当把整个架构都搭建好了以后,发现springmvc配置的control总是映射不到,总是报No mapping found for HTTP request with URI,导致无法执行逻辑层: 经过两天的不断尝试(期间spring源码都翻看了一些,而且通过调试spring代码找原因,最终也没找到),偶然之间觉得使用maven的clean和install的方式打成war试了一下,居然问题不存在了.考虑了一

Spring3中js/css/jpg/gif等静态资源无法找到(No mapping found for HTTP request with URI)问题解决(转)

最近项目中使用到Spring3,在感叹Spring3注解配置清爽的同时竟然出现了这个不和谐的事情,实在无法忍受 问题:部署项目后程序加载或用浏览器访问时出现类似的警告,2011-01-19 10:52:51,646 WARN [org.springframework.web.servlet.PageNotFound] -<No mapping found for HTTP request with URI [/sandDemo001/images/1.jpg] in DispatcherServ

No mapping found for HTTP request with URI [/HelloWeb/] in DispatcherServlet with name &#39;HelloWeb&#39; Spring MVC

I'm learning the Spring Framework, and I'm doing the HelloWeb tutorial on tutorialspoint, and I can't get it working. I'm using Spring MVC 4.0, and I'm deploying my app from Netbeans 8.0 to a Glassfish Server. http://www.tutorialspoint.com/spring/spr

问题 “No mapping found for HTTP request with URI [/rbiz4/uploadFile.html]” 的解决

从以前的SpringMVC项目简化一下做个例子,结果出现了下面的错误: No mapping found for HTTP request with URI [/rbiz4/uploadFile.html] 上面这条信息是从MyEclipse的控制台里找出来的. 这条信息就是指/rbiz4/uploadFile.html这样的请求找不到对应信息了,于是依次检查 1.jsp文件 2.controller文件 3.web.xml 发现: 1.jsp文件form的action就是uploadFile.

相对路径获取项目文件 及报错 No mapping found for HTTP request with URI XXX in DispatcherServlet with name ‘springmvc’解决方法

首先一点,WebRoot目录下的文件是都可以通过浏览器输入路径,直接读取到的 例如这样: 而WebRoot下面WEB-INF是无法浏览器输入路径直接读取的. 因为是受保护的. 如果jsp读取一个图片的话. jsp在WebRoot/jsp下 图片在WebRoot/imag下 那么就要../imag/xx.jpg获取相对路径. 因为servlet程序是无法读取C:\xx\xx\xx这样的绝对路径的. 除非更改tomcat配置文件,但我觉得那样完全没有意义. 另外,要注意你请求的路径是否被拦截. 例如

No mapping found for HTTP request with URI

新在学习Spring3.0,AngularJS和Bootstrap时,一直在考虑如果把这三者结合起来.今天在尝试的过程中,遇到了拦路虎.No mapping found for HTTP request with URI [/springmvc/js/bootstrap.min.js] web.xml的配置如下 <servlet-mapping> <servlet-name>mumu</servlet-name> <url-pattern>/</url