今天搭建spring mvc的系统,成功启动后无法访问,提示如下:
No mapping found for HTTP request with URI [/admin/log.do] in DispatcherServlet 。
原因:<context:component-scan base-package="com.ecp.web"/> 这一段必须写在*-servlet.xml文件中。否则就算你在配置文件中引入了所有的头文件,spring都不会管你长得多好看!
警示:如果我们的项目采用了springMVC,那么,组件扫描、mybatis的dao扫描最好都在这个 *-servlet.xml中指定。不然就会出现在启动时找不到Bean.
<?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:aop="http://www.springframework.org/schema/aop" xmlns:p="http://www.springframework.org/schema/p"
xmlns:mvc="http://www.springframework.org/schema/mvc"
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/tx
http://www.springframework.org/schema/tx/spring-tx-4.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
<mvc:annotation-driven />
<!-- 多个以逗号分隔 -->
<context:component-scan base-package="com.ecp.web"/>
<mvc:resources location="/ext-3.0.0/**" mapping="/ext-3.0.0/" />
<mvc:resources location="/ecpres/**" mapping="/ecpres/" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/pages/"></property>
<property name="suffix" value=".jsp"></property>
</bean>
<!--扫描自动注入DAO -->
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<!-- 多个以逗号分隔 -->
<property name="basePackage" value="com.ecp.web.dao" />
</bean>
</beans>
For myself: 添加新的模块,必须在*-servlet.xml配置文件中 配置controller的路径 、services的路径 ,以及mybatis的dao路径 。
相关推荐
delphi 2010升级到xe8后,decodestring汉字出现:No mapping for the.mht
当我们遇到“Spring MVC No Session found for current thread”的错误时,这通常意味着在尝试访问HttpSession对象时,当前线程没有找到相关的session。这个问题可能是由于多种原因导致的,包括配置错误、过滤器设置...
Simultaneous Localization and Mapping for Mobile Robots: Introduction and Methods Simultaneous Localization and Mapping for Mobile Robots: Introduction and Methods
本文介绍的论文《Improved Techniques for Grid Mapping with Rao-Blackwellized Particle Filters》详细探讨了基于 RBPFs 的 SLAM 方法,并提出了一系列创新性的改进措施,旨在提高算法的效率和准确性。这些改进...
### 实用且强大的今日GPU凹凸贴图技术 #### 摘要与介绍 本文《实用且强大的今日GPU凹凸贴图技术》由NVIDIA公司的Mark J. Kilgard撰写,详细介绍了利用现代图形处理器单元(Graphics Processing Unit, GPU)实现凹凸...
### Informatica工作流Mapping Architect for Visio的批量开发 #### 一、概述 本文主要探讨如何利用Informatica的Mapping Architect for Visio插件,在Informatica平台上实现高效的工作流批量设计,尤其是在处理源...
Disease Mapping with WinBUGS and MLwiN provides a practical introduction to the use of software for disease mapping for researchers, practitioners and graduate students from statistics, public health ...
资源名:A mapping package for Matlab_地图工具箱_matlab 资源类型:matlab项目全套源码 源码说明: 全部项目源码都是经过测试校正后百分百成功运行的,如果您下载后不能运行可联系我进行指导或者更换。 适合人群:...
Pose graphs have become a popular representation for solving the simultaneous localization and mapping (SLAM) problem. A pose graph is a set of robot poses connected by nonlinear constraints obtained ...
request_mapping import request_mapping@ request_mapping ( "/user" )class UserView ( View ): @ request_mapping ( "/login/" , method = "post" ) def login ( self , request ): data = request . POST return...
在AUTOSAR标准中,Memory Mapping规范还定义了一些其他的概念和机制,包括NO-INIT Policy、VendorApiInfix、Core Scope等。NO-INIT Policy是指一种内存初始化策略,用于在软件组件启动时初始化内存空间。...
标题中提到的“Improved Techniques for Grid Mapping With Rao-Blackwellized Particle Filters”揭示了研究者们关注的核心问题在于如何改进网格地图构建技术,尤其是使用Rao-Blackwellized粒子滤波器的方法。...
### 基于Mapping Architect for Visio的工作流批量开发详解 #### 一、概述 本文主要探讨了如何利用Mapping Architect for Visio插件在Informatica平台上实现高效的工作流批量设计,特别是针对源表和目标表表结构...
《Mapping, Planning and Exploration with Pose SLAM》是一本由Rafael Valencia和Juan Andrade-Cetto编写的SLAM(Simultaneous Localization and Mapping,即同时定位与建图)领域的专业书籍,由Springer出版社在...
Deep learning with convolutional neural networks for brain mapping and decoding of movement-related information from the human EEG