




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、毕业设计外文资料翻译题目名称: 基于SSH的web技术介绍 学 院: 计算机科学技术学院 专业年级: 网络工程12级 学生姓名: 冯金明 班级学号: 2班4号 指导教师: 邵珠富 二一六 年 四 月 三十 日译文题目: 基于SSH的web技术介绍 原文题目: SSH based web technology introductio 原文出处: SSH based on Web Technology1、IntroductionOne preface along with the Java technique of gradual mature and perfect, Be establishm
2、ent business enterprise class application of standard terrace, the J2 EE terrace got substantial of development .Several technique asked for help from to include in the J2 EE norm : Enterprise JavaBean (EJB), Java Servlets (Servlet), Java Server Pages(JSP), Java Message Service(JMS).etc., developmen
3、t many application system.But, also appeared some problem in the tradition J2 the EE the application of the development the process:1)the antinomy of of data model and logic model. Currently the database of usage basically and all is relation type database, but the Java be essentially a kind of the
4、language which face to object, object at saving with read usage SQL and JDBC carry on a database operation and lowered plait distance of efficiency and system of can maintenance;2)tradition of J2 EE application much the adoption is according to the EJB heavy weight frame, this kind of frame suitable
5、 for develop a large business enterprise application, but usage the EJB container carry on development and adjust to try to need to be waste a great deal of time.For lowering the Ou of code to match sex, exaltation system of development efficiency, this text put forward 1 kind EE according to the J2
6、 of the Struts frame and Spring frame and the Hibernate frame application development strategy. 2、Use the Struts realization MVC structure use the Struts realization MVC structure MVC(Model-View-Controller) is put forward by the Trygve Reenskaug, first drive application in the environment SmallTalk-
7、80, is many to hand over with each other with interface system of constitute foundation. According to the need of variable of the interface design, MVC hand over with each other constitute of system to resolve into model and see diagram, controller three part. Model(Model) is software processing pro
8、blem logic at independence in outside manifestation under contents and form circumstance of inside abstract, packed the core data, logic of problem and function of calculation relation, independence in concrete of interface expression and I/O operation. See diagram(View) mean information and particu
9、lar form demonstration of model data and logic relation and appearance to the customer. It acquire a manifestation information from the model, there can be many for homology of information dissimilarity of manifestation form or see diagram. The controller(Controller) is a processing the customer han
10、d over with software with each other operation of, its job is control provide model in any variety of dissemination, insure a customer interface among the model of rightness should contact; It accept a customer of importation, give° the importation feedback model, then realization compute model
11、 control, is make model and see diagram to moderate work of parts. Usually 1 see a diagram rightness should a controller. Model, see separate of diagram and controller, make a model be able to have many manifestation to see diagram. If the customer pass a certain see the controller of diagram change
12、 the data of model, all other dependence in these see of data diagram all should reflection arrive these variety. When therefore and regardless occurrence what data variety, controller all would variety notice ally see diagram, cause manifestation of renewal. This is actually a kind of variety of mo
13、del-dissemination mechanism. The Struts frame is to be the item of Apache Jakarta to constitute part to publish luck to do at the earliest stage, it inherited MVC of each item characteristic, and did according to the characteristics of J2 EE correspond of variety with expand. The Struts frame was go
14、od to combine Jsp , Java Servlet , Java Bean, Talia etc. technique. In the Struts, what to undertake the controller role in the MVC be an ActionServlet. The ActionServlet is an in general use control module. This control module provided a processing all HTTP claim which send out Struts of entrance p
15、oint. Its interception with distribute these claim to arrive correspond of action type.(these action all of type is Action son type)Moreover the control module is also responsible for using to correspond of claim the parameter fill Action Form(FromBean), and pass action type(ActionBean).Action type
16、the business logic of the interview core, then interview Java Bean or adjust to use EJB. End action type control the power pass follow-up of JSP document, from JSP document born see diagram. All these control logic make use of Struts-config.xml the document come to allocation. See diagram in the Str
17、uts frame main from JSP born page completion, the Struts provide abundant of JSP label database, this is advantageous to separating performance logic and procedure logic.The model is with 1 or the form existence of several Java Bean. In the Struts, main existence three kinds of Bean, respectively BE
18、: Action, ActionForm, EJB perhaps Java Bean. The Struts frame have no concrete definition model layer of realization, in actually the development, model layer usually is close with business logic connect with each other, and want to carry on operation to the first floor data. The underneath's in
19、troduction is a kind of development strategy, lead the Hibernate into the model layer of Struts frame, usage it to carry on a data to pack with reflect to shoot, provide hold out for long time turn of support. 4 usage Hibernate and the Struts development J2 EE application 4.1 system structure diagra
20、m 3 manifestation according to Hibernate and Struts development strategy of system structure diagram. 3、Spring the Application Framework Spring isn't particularly a web framework but a generic lightweight application framework with dedicated web support, and show the architectural differences to
21、 Struts and WebWork .In contrast to Struts or WebWork, Spring is an application framework for all layers: It offers a bean configuration foundation, AOP support, a JDBC abstraction framework, abstract transaction support, etc. It is a very non-intrusive effort: Your application classes do not need t
22、o depend on any Spring classes if not necessary, and you can reuse every part on its own if you like to. From its very design, the framework encourages clean separation of tiers, most importantly web tier and business logic: e.g. the validation framework does not depend on web controllers. Major goa
23、ls are reusability and testability: Unnecessary container or framework dependencies can be considered avoidable evils.Of course, Spring's own web support is nicely integrated with the framework's general patterns. Nevertheless, replacing the web solution with Struts, WebWork, or the like is
24、easy. Both with Spring's web support or a different one, Spring allows for building a true dedicated middle tier in the web container, with the option to reuse exactly the same business logic in test environments or standalone applications. And within J2EE, your business logic will not unnecessa
25、rily depend on container services like JTA or EJB - allowing complex, well-architected web applications to run in a "simple" container like Tomcat or Resin.Note that Spring doesn't generally aim to compete with existing solutions. It rather fosters seamless integration with standards l
26、ike Servlet, JSP, JTA, JNDI, JDBC, and JDO, and well-suited tools like Hibernate, Velocity, Log4J, and Caucho's Hessian/Burlap. The framework is designed to grow with the needs of your applications, in terms of technology choice: For example, you will probably use JTA via Spring's JtaTransac
27、tionManager if you need distributed transactions - but only then, as there are perfect replacements for single databases, like DataSourceTransactionManager or HibernateTransactionManager.4、The Design of Spring's Web Framework Spring's web framework is designed around a DispatcherServlet that
28、 dispatches requests to handlers, with configurable handler mappings, view resolution, and locale and theme resolution. The default handler is a very simple Controller interface, just offering a "ModelAndView handleRequest(request,response)" method. This can already be used for application
29、 controllers, but you will prefer the included implementation hierarchy, consisting of AbstractController, AbstractCommandController, MultiActionController, SimpleFormController, AbstractWizardFormController. Application controllers will typically be subclasses of those. Note that you can choose an
30、appropriate base class: If you don't have a form, you don't need a FormController. This is a major difference to Struts.You can take any object as command or form object: There's no need to implement an interface or derive from a base class. Spring's data binding is highly flexible,
31、e.g. it treats type mismatches as validation errors that can be evaluated by the application, not as system errors. So you don't need to duplicate your business objects' properties as Strings in your form objects, just to be able to handle invalid submissions, or to convert the Strings prope
32、rly. Instead, it's often preferable to bind directly to your business objects. This is another major difference to Struts which is built around required base classes like Action and ActionForm - for every type of action. Compared to WebWork, Spring has more differentiated object roles: It
33、supports the notion of a Controller, an optional command or form object, and a model that gets passed to the view. The model will normally include the command or form object but also arbitrary reference data. Instead, a WebWork Action combines all those roles into one single object. WebWork does all
34、ow you to use existing business objects as part of your form, but just by making them bean properties of the respective Action class. Finally, the same Action instance that handles the request gets used for evaluation and form population in the view. Thus, reference data needs to be modelled as bean
35、 properties of the Action too. These are arguably too many roles in one object.Regarding views: Spring's view resolution is extremely flexible. A Controller implementation can even write a view directly to the response, returning null as ModelAndView. In the normal case, a ModelAndView instance
36、consists of a view name and a model Map, containing bean names and corresponding objects (like a command or form, reference data, etc). View name resolution is highly configurable, either via bean names, via a properties file, or via your own ViewResolver implementation. The abstract model Map allow
37、s for complete abstraction of the view technology, without any hassle: Be it JSP, Velocity, or anything else - every renderer can be integrated directly. The model Map simply gets transformed into an appropriate format, like JSP request attributes or a Velocity template model.5、Hibernate the Applica
38、tion FrameworkData's holding out for long time layer and Hibernate is one piece according to hold out for long time layer frame, is a kind of realization object and relation of the tool which reflect to shoot(O/R Mapping), it carried on the object of the lightweight to pack to the JDBC and make
39、procedure member can usage object plait distance thought to operation database. It not only provided to shoot from Java to reflect of data form, but also provided a data a search and instauration mechanism. Opposite in usage JDBC and SQL to operation database, use Hibernate ability consumedly of exa
40、ltation realization of efficiency. The Hibernate frame use allocation document of the form come to the reflect of the definition Java object and data form to shoot relation, in the meantime at more deep of level of data form of relation explanation for the relations such as inherit of and containmen
41、t etc. of Java object. Pass the usage HQL language sentence complications of relation the calculate way use the way of object description, to a large extent simplification logarithms according to of search, speed development of efficiency. Have in the Hibernate a simple but keep the API of view, use
42、d for to the database mean of object performance search. Want to establish or the modification be these objects, need in the procedure carry on with them to hand over with each other, then tell Hibernate to keep. So, a great deal of pack hold out for long time turn operation of business logic no lon
43、ger demand write a trivial JDBC language sentence, make data last long thus the layer got biggest of simplification. 6、Use Hibernate and Struts to develop J2EE application Development practice underneath combine a development practice, with in the J2 the EE the application very widespread customer r
44、egister process for example, elucidation above-mentioned system structure is how concrete usage. The process of register is very clear: Customer from register page login.jsp importation register information, system to register the information carry on verification, if exactitude success register, ot
45、herwise hint correspond mistake information. In the development process, the usage Eclipse be used as development environment and added to carry to provide to the Struts and the Hibernate in the meantime better control and support of three square plug-in MyEclipse, Web server usage Tomcat, the datab
46、ase chose to use Mysql. Carry on an allocation to the Hibernate first, need to the system auto the born hibernate.cfg. xml carry on modification, allocation good database conjunction of various parameter and definition the data reflect to shoot a document. Because the Hibernate take of conjunction p
47、ond main used for test, the function isn't very good, can pass JNDI will it modification is usage Tomcat of conjunction pond.7、SummaryIn this paper, we introduced the Struts application framework. And introduces some basic knowledge about Spring and Hibernate,. We also show how to use Hibernate
48、and Struts development J2EE, and how it used to be servlets and JSP in combination in the same application. Now that you have a taste of the Strtus Web application, after that we will dig deeper into the theory and practice behind the Struts architectu基于SSH的web技术介绍1、引言 随着Java技术的逐渐成熟与完善,作为建立企业级应用的标准平
49、台,J2EE平台得到了长足的发展。借助于J2EE规范中包含的多项技术:Enterprise JavaBean(EJB)、Java Servlets(Servlet)、Java Server Pages(JSP)、Java Message Service(JMS)等,开发出了许多应用系统。但是,在传统J2EE应用的开发过程中也出现了一些问题:1)数据模型和逻辑模型之间的矛盾。目前使用的数据库基本上都是关系型数据库,而Java本质上是一种面向对象的语言,对象在存储和读取时使用SQL和JDBC进行数据库操作,降低了编程的效率以及系统的可维护性。2)传统的J2EE应用多采用基于EJB的重量级框架,这种
50、框架适合于开发大型企业应用,但是使用EJB容器进行开发和调试需要耗费大量时间。为了降低代码的耦合性,提高系统的开发效率,本文提出了一种基于Struts框架、Spring框架和Hibernate框架的J2EE应用开发策略。 2、用Struts实现MVC架构 MVC(Model-View-Controller)由Trygve Reenskaug提出,首先被应用在SmallTalk-80环境中,是许多交互和界面系统的构成基础。根据界面设计可变性的需求,MVC把交互系统的组成分解成模型、视图、控制器三部分。 模型(Model)是软件所处理问题逻辑在独立于外在显示内容和形式情况下的内在抽象,封装了问题的
51、核心数据、逻辑和功能的计算关系,独立于具体的界面表达和I/O操作。视图(View)把表示模型数据及逻辑关系和状态的信息及特定形式展示给用户。它从模型获得显示信息,对于相同的信息可以有多个不同的显示形式或视图。控制器(Controller)是处理用户与软件的交互操作的,其职责是控制提供模型中任何变化的传播,确保用户界面于模型间的对应联系;它接受用户的输入,将输入反馈给模型,进而实现对模型的计算控制,是使模型和视图协调工作的部件。通常一个视图对应一个控制器。模型、视图与控制器的分离,使得一个模型可以具有多个显示视图。如果用户通过某个视图的控制器改变了模型的数据,所有其它依赖于这些数据的视图都应反映
52、到这些变化。因此,无论何时发生了何种数据变化,控制器都会将变化通知所有的视图,导致显示的更新。这实际上是一种模型的变化-传播机制。 Struts框架最早是作为Apache Jakarta项目的组成部分问世运做,它继承了MVC的各项特性,并根据J2EE的特点,做了相应的变化与扩展。Struts框架很好的结合了Jsp,Java Servlet,Java Bean,Taglib等技术。在Struts中,承担MVC中控制器角色的是ActionServlet。ActionServlet是一个通用的控制组件。这个控制组件提供了处理所有发送到Struts的HTTP请求的入口点。它截取和 分发这些请求到相应的
53、动作类(这些动作类都是Action类的子类)。另外控制组件也负责用相应的请求参数填充Action Form(FromBean),并传给动作类(ActionBean)。动作类访问核心商业逻辑,即访问Java Bean或调用EJB。最后动作类把控制权传给后续的JSP文件,由JSP文件生成视图。所有这些控制逻辑利用Struts-config.xml文件来配置。在Struts框架中,视图主要由JSP生成页面完成,Struts提供丰富的JSP标签库,这有利于分开表现逻辑和程序逻辑。模型以一个或多个Java Bean的形式存在。在Struts中,主要存在三种Bean,分别是:Action,ActionFo
54、rm,EJB或者Java Bean。 Struts框架没有具体定义模型层的实现,在实际开发中,模型层通常是和业务逻辑紧密相连的,并且要对底层数据进行操作。下面介绍一种开发策略,将Hibernate引入到Struts框架的模型层中,使用它来进行数据封装和映射,提供持久化的支持。3、Spring 应用构架 Spring明显区别于其他轻量级application framework, 它将专注于web的支持,与struts 和 webwork有着明显的区别。在和struts 和 webwork的对比上,Spring是一个服务于所有层面的application framework:提供了bean的配置
55、基础,AOP的支持,JDBC的提取框架,抽象事务支持,等等。它有一个非常显著的特点:在某个层面上如果你不需要Spring的支持,你就可以不使用String的class,只使用它的某一部分的功能。 从它的设计理念,你可以看到String 帮助你实现了真正的逻辑层和web层的分离:例如。一个校验应用将不用依靠controllers,就可以实现。这样的目标是 更好的重用和易测:过分依靠不必要的容器和框架将不能实现这一点。当然,Spring 的自己的web支持和通常框架模式的细致完整.然而,Spring替换struts,webwork或者其他的web方案非常的容易.对于Spring的web支持或者不同
56、的地方,Spring 允许你在web容器里面建立一个中间层,在测试环境或者标准独立的应用里面来设置重用你的商务逻辑.还有在J2EE环境里面,你的商务逻辑不必依靠容器提供的服务,像JTA ,EJB的支持.良好的构架的web应用可以运行在任何容器上,如,Tomcat 或者 Resin. 值得注意的是,Spring 不是和已经存在的解决方案进行竞争. 我们鼓励结合标准的技术,如, Servlet, JSP, JTA, JNDI, JDBC, and JDO, 和非常匹配的工具,如,Hibernate, Velocity, Log4J, and Caucho's Hessian/Burlap.
57、这个框架的的设计思想是在你的应用需要改良的时候,你将会做一些技术的选择:例如,如果你需要分布式事务处理,你可能需要用Spring的Jta TransactionManager 来实现JTA服务.或者,用DataSourceTransactionManager or HibernateTransactionManager 来实现美妙完美的单个数据库交换。4、Spring web 框架的设计思想Spring 框架通过配置操作mappings,展示resolution,本地化和模版集成围绕着分派请求操作的servlet - DispatcherServlet设计的.缺省的操作是一个非常简单的控制接口, 他只提供了ModelAndView handleRequest(request,response)方法.这将用于一个应用的控制,但是,如果你想包含多个层次的控制,AbstractController, AbstractCommandController, MultiActionController, SimpleFormController, AbstractWizardFormController 将帮助你完成.应用控制将代表那些子系统.注意,你可以选择一个适当的基类:如果你没有 we
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 技术许可与使用合作协议修订版
- 与时间赛跑的励志议论文文章4篇范文
- 跨领域协同机制对综合交通枢纽承载能力的促进作用
- 村级集体合作社成立合同
- 出差办公地点规划表格化管理工具使用表格
- 教学资料清单表格版
- Python大数据分析与挖掘实战:微课版(第2版)课件 第7章 集成学习与实现
- DB14-T 3414-2025 花境植物应用技术指南
- IT技术产业数据表
- 生物科技研发中心合作协议
- 景观设计师劳动合同电子版
- 2024届重庆市南岸区小学六年级语文毕业检测指导卷含答案
- (正式版)HGT 6313-2024 化工园区智慧化评价导则
- 2024年陕西高职分类考试招生考试政策宣讲课件
- 【真题】2023年镇江市中考道德与法治试卷(含答案解析)
- 脑机接口技术在康复医学中的应用与创新
- 《真空系统设计》课件
- 《新模式英语4(第二版)》 课件 Unit 7 On the Job
- 家庭语言环境与儿童语言发展
- 设备采购 投标方案(技术方案)
- 清华人工骨成人颅骨修补首选课件
评论
0/150
提交评论