实验四spring的基本用法

实验四spring的基本用法

ID:35342356

大小:68.85 KB

页数:8页

时间:2019-03-23

实验四spring的基本用法_第1页
实验四spring的基本用法_第2页
实验四spring的基本用法_第3页
实验四spring的基本用法_第4页
实验四spring的基本用法_第5页
资源描述:

《实验四spring的基本用法》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、实验四Spring的基本用法班级:计算机学号:13034480149姓名:刘炳君成绩:一、实验目的(1)理解Spring的loC原理。(2)掌握Spring的loC的实现过程。(3)掌握loC的依赖注入方法。二、实验内容(1)完成课本P176实验九。邈Problems匡TasksB5纸的显示dWebBrowser旦ConscieS34%ServersTestPrinter[JavaApplication]C:ProgramFiIesJavajdkl.8.0^73binjavlog4j:k

2、ARNMoappenderscouldbefoundforlogger(org.springframework.Iog4j:WARF4Pleaseinitializethelog4jsystemproperly.遲■层)丸威■■第缁畏务恳.£是检黑樽ik务间歩含龙空宏吏等工吃敖王==^2^==A4纸的显示池Problems运Tasks“WebBrowser曰ConsoleS3衆ServersTestPrinter[JavaApplication]C:ProgramFiIesJavajdkl.

3、8.0_73llog4j:WARNNoappenderscouldbefoundforlogger(org>springf厂a血log4j:WARMPleaseinitializethelog4jsystemproperly<具勺的J2EE三展方怜分为丢反层・*;«!层(业务逻稳目)定立绢舉务展・三展惨黑再业务股!3h敌樹为闽及■■第1艮■■==穷2豆==TestPrinter.javapackagecom;importorg.springframework.context.ApplicationContext;imp

4、ortorg.springframework.context.support.ClassPathXmlApplicationContext;importcom.prin.Printer;publicclassTestPrinter{publicstaticvoidmain(String[]args){ApplicationContextcontext=newClassPathXmlApplicationContext(”applicationContext.xm「');Printerprinter=(Printer)co

5、ntext.getBean(,,printern);Stringstr=型的J2EE三层结构,分为表现层、中间层(业务逻辑层)和数据服务层。三层体系将业务规则、”+”数据访问及合法性效验等工作放在中间层处理。”+”客户端不直接与数据库交互,而是通过组件与中间层建立连接,再由中间层与数据库交互。printer.print(str);}}TextPaper.javapackagecom;publicclassTextPaperimplementsPaper{privateprivateprivateprivateprivat

6、eprivateStringcontent=nn;charPerLine=16;linePerPage=5;posX=0;posY=0;posP=l;setCharPerLine(intcharPerLine){intintintintintpublicvoidthis•charPerLine=charPerLine;}publicintgetCharPerLine(){returncharPerLine;}publicvoidsetLinePerPage(intlinePerPage){this.linePerPage

7、=linePerPage;}publicintgetLinePerPage(){returnlinePerPage;}publicStringgetContent(){//TODOAuto-generatedmethodstubStringret二this.content;if(!(posX==0&&posY==0)){intcount=linePerPage・posY;for(inti=0;i

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。