No mapping found for HTTP request with URI [/jeecg/personController.do] in Di...
按教程做了个person的人员管理页面,用代码生成器生成的,然后添加了菜单,分配了角色。但是点击这个菜单就打不开页面,HTTP Status 404 ,报了以下错误:No mapping found for HTTP request with URI in DispatcherServlet with name 'springMvc'
这个怎么解决呢?
新增加的包路径需要配置一下扫描路径,具体如下:
control配置扫描:
src/main/resources/spring-mvc.xml<context:component-scan base-package="org.jeecgframework.web.*">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Service" />
</context:component-scan>serverice配置扫描:
/jeecg-framework/src/main/resources/spring-mvc-hibernate.xml/jeecg-framework/src/main/resources/spring-mvc-hibernate.xmlentity配置扫描:
src/main/resources/spring-mvc-hibernate.xml<property name="packagesToScan">
<list>
<value>org.jeecgframework.web.system.pojo.*</value>
<value>org.jeecgframework.web.demo.entity.*</value>
<value>org.jeecgframework.web.test.entity.*</value>
<value>org.jeecgframework.web.cgform.entity.*</value>
<value>org.jeecgframework.web.cgreport.entity.*</value>
</list>如果用到minidao,这也需要配置扫描路径:
/main/resources/spring-minidao.xml<!-- 注册MiniDao接口 -->
<bean class="org.jeecgframework.minidao.factory.MiniDaoBeanFactory">
<property name="packagesToScan">
<list>
<value>org.jeecgframework.web.cgreport.dao.*</value>
<value>org.jeecgframework.web.cgform.dao.*</value>
<value>org.jeecgframework.web.system.dao.*</value>
<value>org.jeecgframework.web.demo.dao.*</value>
</list>
</property>
</bean> 二楼的忘记把serverice配置扫描:
/jeecg-framework/src/main/resources/spring-mvc-hibernate.xml的这个配置发出来了。我补充一下:<!-- online生成之后,进行代码生成,对增加的代码的service进行加载,但不加载controller -->
<context:component-scan base-package="com.gaga.*">
<context:exclude-filter type="annotation"
expression="org.springframework.stereotype.Controller" />
</context:component-scan>
页:
[1]