关注JEECG发展历程 关注最新动态和版本, 记录JEECG成长点滴 更新日志 - 技术支持 - 招聘英才

JEECG最新版本下载 JEECG智能开发平台 - 显著提高开发效率 常见问题 - 入门视频 - 参与开源团队

商务QQ: 69893005、3102411850 商务热线(5*8小时): 010-64808099 官方邮箱: jeecgos@163.com

查看: 7787|回复: 2

No mapping found for HTTP request with URI [/jeecg/personController.do] in Di...

[复制链接]
发表于 2014-2-17 16:05:52 | 显示全部楼层 |阅读模式
按教程做了个person的人员管理页面,用代码生成器生成的,然后添加了菜单,分配了角色。但是点击这个菜单就打不开页面,HTTP Status 404 ,报了以下错误:
[org.springframework.web.servlet.PageNotFound]No mapping found for HTTP request with URI [/jeecg/personController.do] in DispatcherServlet with name 'springMvc'

这个怎么解决呢?

发表于 2014-2-17 16:20:42 | 显示全部楼层
新增加的包路径需要配置一下扫描路径,具体如下:

control配置扫描:
src/main/resources/spring-mvc.xml
  1. <context:component-scan base-package="org.jeecgframework.web.*">
  2.                 <context:exclude-filter type="annotation"
  3.                         expression="org.springframework.stereotype.Service" />
  4.         </context:component-scan>
复制代码
serverice配置扫描:
/jeecg-framework/src/main/resources/spring-mvc-hibernate.xml
  1. /jeecg-framework/src/main/resources/spring-mvc-hibernate.xml
复制代码
entity配置扫描:
src/main/resources/spring-mvc-hibernate.xml
  1. <property name="packagesToScan">
  2.                         <list>
  3.                                 <value>org.jeecgframework.web.system.pojo.*</value>
  4.                                 <value>org.jeecgframework.web.demo.entity.*</value>
  5.                                 <value>org.jeecgframework.web.test.entity.*</value>
  6.                                 <value>org.jeecgframework.web.cgform.entity.*</value>
  7.                                 <value>org.jeecgframework.web.cgreport.entity.*</value>
  8.                         </list>
复制代码
如果用到minidao,这也需要配置扫描路径:
/main/resources/spring-minidao.xml
  1. <!-- 注册MiniDao接口 -->
  2.         <bean class="org.jeecgframework.minidao.factory.MiniDaoBeanFactory">
  3.                 <property name="packagesToScan">
  4.                         <list>
  5.                                 <value>org.jeecgframework.web.cgreport.dao.*</value>
  6.                                 <value>org.jeecgframework.web.cgform.dao.*</value>
  7.                                 <value>org.jeecgframework.web.system.dao.*</value>
  8.                                 <value>org.jeecgframework.web.demo.dao.*</value>
  9.                         </list>
  10.                 </property>
  11.         </bean>
复制代码
发表于 2014-5-21 14:16:01 | 显示全部楼层
二楼的忘记把serverice配置扫描:
/jeecg-framework/src/main/resources/spring-mvc-hibernate.xml的这个配置发出来了。我补充一下:
  1. <!-- online生成之后,进行代码生成,对增加的代码的service进行加载,但不加载controller -->
  2.         <context:component-scan base-package="com.gaga.*">
  3.                 <context:exclude-filter type="annotation"
  4.                         expression="org.springframework.stereotype.Controller" />
  5.         </context:component-scan>
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表