第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

spring mvc和spring需要結(jié)合嗎

spring mvc和spring需要結(jié)合嗎

陪伴而非守候 2018-12-30 04:00:46
spring mvc和spring需要結(jié)合嗎
查看完整描述

1 回答

?
紫衣仙女

TA貢獻1839條經(jīng)驗 獲得超15個贊

1.在springmvc配置文件中掃描bean的時候。只掃描包含@controller。因為既然要和spring整合,那么springmvc還是專心做web請求的轉(zhuǎn)發(fā)吧。

2.在spring配置文件中去掉@controller的掃描。其他bean都是單例的,在容器啟動的時候,一起初始花了。

最后,其實單獨使用 springmvc也是可以的。讓他管理所有bean.

1 在主容器中(applicationContext.xml),將Controller的注解打消掉

[html] view
plaincopy

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

2 而在springMVC配置文件中將Service注解給去掉

[html] view
plaincopy

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



查看完整回答
反對 回復(fù) 2019-01-04
  • 1 回答
  • 0 關(guān)注
  • 654 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號