面試題-spring測試題_第1頁
面試題-spring測試題_第2頁
面試題-spring測試題_第3頁
已閱讀5頁,還剩4頁未讀, 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

一、選擇題(254100分下列關(guān)于Spring特性中IoC描述錯誤的是 使用Spring的IoC容器時只需組件需要的對象,在運行時Spring的IoC容器XML配置數(shù)據(jù)提供給它2)在SpringSpring(ASpring提供了一個簡單的數(shù)據(jù)源實現(xiàn)類DriverManagerDataSourceB.Spring在第依賴包中包含了兩個數(shù)據(jù)源的實現(xiàn)類包,其一是Apache的DBCP,C3P0C.Spring提供JNDI資源的類是JndiObjectFactoryBeanD.DriverManagerDataSource比較適合在單元測試或簡單的獨立應(yīng)用中使用下列關(guān)于Spring配置文件的說法不正確的是 Spring的配置文件可以配置在類路徑下,并可以重命名,但是需要在web.xml文件 web.xml中的<context-param><param-name>和<param-value>Spring下面關(guān)于Spring中的bean的作用域,描述錯誤的是 SpringbeanscopeSpringbean的作用域默認(rèn)是beanscopebean下列關(guān)于Spring的裝配模式(default-autowire)描述不正確的是 Springdefault-autowire=”byType”,其它的配置文件某業(yè)務(wù)方法taskApply(Useruser,Listtasks)需要對其進行事務(wù)控制下面的方式不能 將查詢方法為只讀事務(wù),其他方法為doREQUIREDdoTaskApplyC.<tx:methodname="*Apply"propagation="REQUIRED"/>D.事務(wù)的propagation屬性為下列關(guān)于Spring與Hibernate的集成,說法錯誤的是 Spring與Hibernate的集成后,Hibernate的SessionFactory可以讓SpringCSpring的事務(wù)管理,會讓Hibernate:cometcentity/Us.hbm.xml,下列關(guān)于Spring配置數(shù)據(jù)連接池的描述,錯誤的是 Spring可以 Spring數(shù)據(jù)源時,必須引入Hibernate的dbcpcommons-dbcpjar Springbean在Spring的配置文件中,使用<bean>Bean…<tx:methodname="get*"propagation="REQUIRED"read-only="true"/><aop:pointcutid="serviceMethod"expression="execution(*com.etc.service.*.*(..))"/> "pointcut- "… ①②①②①②①②下面關(guān)于Struts2、Hibernate以及Spring整合說法正確是 HibernateHibernateDAO配置在SpringSpringapplicationContext.xml當(dāng)Struts、Hibernate以及Spring整合在一起時,Spring只能管理關(guān)于Spring對Hibernate的支持,下列說法正確的是 SpringHibernateHibernate集使用Spring對Hibernate的支持,無需創(chuàng)建可以在Spring配置文件中配置HibernateSpringHibernate的配Spring提供的HibernateDaoSupportSessionFactorysetter分析下面的Spring配置代碼,可以推斷下列Java語句的運行結(jié)果是 JavaApplicationContextcontext=newClassPathXmlApplicationContext("di.xml");System.out.println(((B)context.getBean("b")).getM());Spring<beanid="a"<beanid="b"class="B"<propertyname="n"value="2"Springdi.xml<beanid="test"<propertyname="i"value="100"由此可以推斷出(ApplicationContextcontext=newClassPathXmlApplicationContext("di.xml");Testtest=(Test)context.getBean("test");iApplicationContextcontext=newClassPathXmlApplicationContext("di.xml");inti=(int)content.getBean("i"); gettersetter分析如下所示的Spring配置文件中的代碼,則選項中的說法正確的是 <aop:pointcut Spring2.0 在某些情況下,并不需要為Bean的每個屬性都設(shè)置值,或者某些屬性已有默認(rèn)Spring通過<bean>dependency-check屬性來設(shè)置依賴檢查或者通過<beans>元素的defauependency-check屬性來設(shè)置全局依賴檢查下列選項中關(guān)于Spring拆分配置文件的說法不正確的是 web.xml文件中使用<context-param>Springimport子元素導(dǎo)入其他配置文件,將多個配置文件整合成一個完整的Spring配置文件Spring配置文件會影響速度,實際項目應(yīng)用中不建議拆分Spring SpringSpringPropertyPlaceholderConfigurer${…}的方式屬性Spring通過JndiObjectFactoryBean類JNDI資源在Spring配置文件中jndiNameJNDI數(shù)據(jù)源名字一樣 <beanid="testBean"<propertyname="dp"value="10"<propertyname="sp"value="mm" ApplicationContextcontext=newClassPathXmlApplicationContext("di.xml");TestBeant=(TestBean)context.getBean("test.TestBean");privateStringdp=TestBean中可能有方法:publicvoidsetSp(Stringdpint也可能是對下面使用Spring依賴注入的代碼,下面說法錯誤的是 ApplicationContextcontextnewPrinterprinter (選擇二項配置文件di.xml位于 di.xmlidnameprinterdi.xml被修改后,context 依賴注入豐富的在Spring中,配置Hibernat

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論