内容摘要当前基于J2EE平台的Web应用在逻辑上一般被分为四层:域模型层、表示层、业务层、数据层。本文主要针对表示层、业务层和持久层的实现提出了基于Webwork+Spring+Hibernate的解决方案。WebWork是一个致力于组件化和代码重用的拉出式MVC模式实现框架,以其灵活、强大的功能为Web应用的构建减轻了负担。Spring是一种轻量级的容器,Spring使系统各组件间达到松散耦合并且能和各种框架很好的兼容。Hibernate是一个开源的持久层框架技术,全面减轻了维护数据的复杂度,使系统具有良好的性能和移植性。本文以港航系统中局办公系统下的个人先进申请为案例,采用基于UML的系统分析方法,通过建立泳道图、用例图、类图对其进行了详细的分析,并在此基础上分别对Web表示层、业务逻辑层、数据持久层进行了详细设计。针对项目特点,整合WebWork、Spring、Hibernate三种框架技术,提出了一个具有通用模式的J2EE架构:WebWork实现MVC模式完成Web表示层功能,其业务逻辑交由Spring来管理;Spring负责管理表现层控制器与数据访问对象间关系,完成业务逻辑层功能;Hibernate负责数据的持久化工作。三种架构的应用能够有效地解决传统Web应用开发中存在的问题,而且采用分层及模块化设计使系统具有很高的可维护性、扩展性、移植性和组件的复用性。关键词:J2EE,WebWork,Spring,HibernateABSTRACTAtpresentaccordingtotheWebapplicationofJ2EEterraceatlogicalisbeendividedinto4Fgenerally:DomainModelLayer,PresentationLayer,BusinesslayerandDatabaselayer.Thistextmainlyaimsattomeanalayer,businesslayerwithheldoutforlongtimetherealizationoflayertoputforwardaccordingtotheWebWork+Spring+Hibernatesolution.WebWorkisapull-outframeworkofimplementingMVCpatternandstrivesforreusingmoduleandcode,itrelievesburdenforconstructingWebapplicationbyitsflexibleandpowerfulfunction.DifferentiatingstronginvasionofEJB,Springwhichisalightweightcontainerisdesignedwithdependencyinjectionandcanmakecomponentloosecouplingdynamicallyandcompatiblewithotherframework.Hibernateisanopensourcepersistenceframework,whichentirelyreducesthecomplexityofmaintainingdataandmakesystemhavehigherperformanceandportable.Thispapertakestheprojectasexample.todetaileddesignforeachlayersuchasWeblayer,businesslogiclayeranddatapersistencelayerbasedonrequirementsanalysiscompletely.Asforthecharacteristicofproject,theauthorintegratedwithWebWork,SpringandHibernateandputforwardageneralmodelofJ2EEarchitecture,whatisthatWebWorkwhichimplementedMVCpatternplaytheroleofWebpresentationlayerandhandoveritsbusinesslogictoSpring,manageobjects’relationofbetweencontrolleranddataaccessobjectthroughSpringandmakedatapersistencebyHibernate.TheapplicationofframeworksisnotonlyresolvetraditionalissuesinWebdesignbutalsoenhancethesystem’smaintainability,expansibility,compatibilityandreusabilitythroughadoptingdelaminationandmodularization.KeyWord:J2EE,WebWork,Spring,Hibernate目录1绪论.......................................................................................................................................................................11.1问题的提出.................................................................................................................................................11.2研究现状与意义..........................................................................................................................................11.3研究内容.....................................................................................................................................................22J2EE平台和MVC架构的介绍.......................................