jeecg開發平臺第一個示例遇到的錯誤

根據開發文檔設計表,建表,生成代碼成功後,登陸到管理界面配置菜單:web


新建一級菜單爲訂單管理,接着在下面建立了一個子菜單爲:訂單列表,對應的菜單地址爲:orderController.do?order,如圖:spring



以後從新登陸系統卻死活也看不到新建的菜單,仔細查看文檔發現須要到角色管理中給管理員角色增長這個菜單的權限,如圖:express



接着現登陸系統即看到剛纔增長的菜單,如圖:spring-mvc



接着點擊"訂單列表「想進入界面,卻發現彈出錯誤提示,而且後臺提示:mvc


[org.springframework.web.servlet.PageNotFound]No mapping found for HTTP request with URI [/jeecg/orderController.do] in DispatcherServlet with name 'springMvc'app


意思應該是找不到對應的連接,修改spring-mvc.xml,在其中增長如下配置便可:spa

<context:component-scan base-package="com.jason.logistics.*">
		<context:exclude-filter type="annotation"
			expression="org.springframework.stereotype.Service" />
	</context:component-scan>

其中com.jason.logistics是我本身的業務包hibernate

另外外還要修改spring-mvn-hibernate.xml,在其中增長如下配置讓spring自動加載service和dao設計

<!-- 自動掃描dao和service包(自動注入) -->
	<context:component-scan base-package="com.jason.logistics.dao.*" />
	<context:component-scan base-package="com.jason.logistics.service.*" />
<!-- 加載service,此時要排除要controller,由於controller已經spring-mvc中加載過了 -->
	<context:component-scan base-package="com.jason.logistics.*">
		<context:exclude-filter type="annotation"
			expression="org.springframework.stereotype.Controller" />
	</context:component-scan>

修改spring-mvn-hibernate.xml,在其中增長如下配置讓spring自動加載新增本身業務包中的實體(其中com.jason.logistics.entity.*是本身業務包的實體所在的包)code

<!-- 註解方式配置 -->
		<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>
				<value>com.jason.logistics.entity.*</value>
			</list>
		</property>
相關文章
相關標籤/搜索