外文翻译---JSP技术与主流JAVA+EE开源框架(SSH)技术简介
JSP技术简介

第1章JSP技术简介JSP(Java Server Pages)技术是由Sun公司发布的用于开发动态Web应用的一项技术。
它以其简单易学、跨平台的特性,在众多动态Web应用程序设计语言中异军突起,在短短几年中已经形成了一套完整的规范,并广泛地应用于电子商务等各个领域中。
在国内,JSP 现在也得到了比较广泛的重视,得到了很好的发展,越来越多的动态网站开始采用JSP技术。
本章就对JSP及其相关技术进行简单的介绍。
1.1 认识HTTP协议HTTP协议(Hypertext Transfer Protocol,超文本传送协议)是WWW服务器使用的主要协议,对HTTP协议细节的基本理解是编写JSP或Java小程序的开发人员所必需的。
因此在学习JSP技术之前有必要更加仔细地研究一下HTTP消息的格式(这里的讨论源自HTTP/1.1协议规范。
参见规范2616,网址为/rfc/rfc2616.txt)。
HTTP 协议的关键部分有HTTP请求和HTTP响应,以及客户端Web程序设计的一些基础知识,在第4章4.4节将会具体介绍。
1.2 客户端Web程序设计介绍Web浏览器现已成为深受大多数用户喜爱的用户界面。
HTML语言提供了丰富的控件,第三方厂商提供了Visual Basic编写的数百个额外的控件,这些都使得Web浏览器独具特色。
虽然Web浏览器与传统的GUI界面有一定的差距,但它提供了一种独立而又简单的方法来访问分布式资源,尤其是Internet资源。
而且越来越多的客户端Web程序扩展技术变得更加成熟,出现了包括CSS、JavaScript、VBScript、动态HTML、Java1.1.Applet应用程序等技术在内的客户端Web程序设计技术,它们的相互结合使得Web程序更加迷人。
下面简单介绍几种常用的客户端Web程序设计技术的特点。
本书假定读者对这些技术都有一定的了解,不对这些技术作详细介绍。
1.2.1 CSSCSS(Cascading Style Sheets)称为层叠样式表,是动态HTML技术的一个部分,但可以和HTML结合使用。
Java框架的演化历程

Java框架的演化历程Java是一门广泛应用于软件开发领域的编程语言,具有简单易学、面向对象、跨平台等特点。
而Java框架则是一种在Java语言基础上构建的软件开发平台,用于简化和加速应用程序的开发过程。
在Java框架的演化历程中,不同的框架相继出现,为开发者提供了更多选择和便利。
本文将从早期的Java EE到现代的Spring框架,介绍Java框架的发展演化过程。
一、Java EEJava EE (Java Enterprise Edition) 是最早的Java框架之一,它于1999年首次发布。
Java EE提供了一套标准的服务器端开发模型,涵盖了面向企业级应用开发的各种技术和规范。
它主要包括Web应用程序的开发、事务处理、持久化、消息传递、安全性和远程访问等领域。
Java EE的框架以EJB (Enterprise JavaBeans) 为核心,它提供了一种用于开发企业级组件的规范和框架。
开发者可以使用EJB构建可重用的、高性能的、复杂的分布式应用程序。
然而,由于EJB的复杂性和低效性,Java EE在实际开发中面临着一些挑战。
二、StrutsStruts是一个基于MVC (Model-View-Controller) 设计模式的Java Web框架,它于2000年首次发布。
Struts框架通过将应用程序的不同层分离,使得开发人员能够更好地组织和维护代码。
它提供了一个核心控制器,用于处理用户请求和路由到正确的处理程序。
Struts框架的优点在于它明确的分层结构和大量的开发工具和插件支持。
然而,Struts对于开发者而言仍然相对繁琐,开发效率有待提高。
三、HibernateHibernate是一个用于Java对象与关系数据库之间的映射和持久化的框架,它于2001年首次发布。
Hibernate框架通过使用ORM (Object Relational Mapping) 技术,简化了Java对象和数据库之间的映射关系。
Java语言框架发展历程

Java语言框架发展历程Java语言是一种广泛应用于软件开发领域的编程语言,而Java框架则是基于Java语言提供的一种开发平台,它提供了一系列的工具和库,帮助开发人员更高效地构建和管理应用程序。
本文将回顾Java语言框架的发展历程,并探讨一些常用的Java框架。
一、JavaEE框架JavaEE(Java Enterprise Edition)是一个用于构建企业级应用程序的Java平台。
最早的JavaEE框架是J2EE(Java 2 Enterprise Edition),它于1999年发布。
J2EE包含了许多组件和技术,如Java Servlet、JavaServer Pages(JSP)、Enterprise JavaBeans(EJB)等,用于支持企业级应用的开发和部署。
随着时间的推移,JavaEE框架逐渐发展壮大,先后推出了JavaEE 5、JavaEE 6、JavaEE 7、JavaEE 8等版本,每个版本都带来了新的功能和改进。
二、Spring框架Spring框架是一个轻量级的Java框架,它的目标是简化企业级Java应用的开发。
Spring框架最初由Rod Johnson于2003年创建,旨在解决当时J2EE开发中的一些问题,如复杂性和低效性。
Spring框架提供了一整套解决方案,包括依赖注入、面向切面编程、控制反转等,帮助开发人员构建松耦合、可测试和可扩展的应用程序。
随着时间的推移,Spring框架不断发展并推出了Spring Boot、Spring MVC、Spring Security等相关项目,为Java开发提供了更多的选择和便利。
三、Hibernate框架Hibernate是一个Java持久化框架,旨在简化应用程序与关系数据库之间的交互操作。
Hibernate框架的诞生解决了Java开发中的对象关系映射(ORM)问题。
通过Hibernate框架,开发人员可以使用简单的Java对象(POJO)代替传统的SQL语句进行数据操作,提高了开发效率和代码的可读性。
javaee是什么

javaee是什么JavaEE拥有广泛市场的原因之一就是可以使用多种框架来使开发变得简单,今天我主要给大家分享〔java〕ee是什么,希望对你们有帮助!JavaEE概念JavaEE,Java 平台企业版(Java Platform Enterprise Edition),原名Java 2 Platform,Enterprise Edition(J2EE),2018年3月更名为 Jakarta EE(该名称目前还没被公众认可)。
狭义的Java EE是Sun公司为企业应用推出的标准平台,它用于开发B/S架构软件,可以说是一个框架或一种规范。
广义的Java EE包括各种框架,其中最重要的是Spring全家桶。
Spring诞生之初是为了改善Java EE开发的体验,并逐渐成为Java网页开发的实际标准。
JavaEE和JavaSE的区别和联系JavaEE建立在JavaSE的基础上,是JavaSE的扩大,添加了一些更便捷的应用框架。
除了EE和SE之外,还有针对移动终端的JavaME,但目前还没有广泛使用。
JavaEE主要技术JavaEE声称拥有13项核心技术,它们是JDBC、JNDI、EJB、RMI、Servlet、JSP、XML、JMS、Java IDL、JTS、JTA、JavaMail和JAF。
简要介绍必须要密切关注的技术。
JDBCJava数据库连接(JDBC)是一个在Java语言中使用的应用程序接口,用于规范客户端程序访问数据库的方式,提供查询和更新数据库中数据的方法。
JNDIJava命名和目录接口(JNDI)是Java的目录服务应用程序界面(API),它提供了一个目录系统,并将服务名称与对象相关联,从而使开发人员能够在开发过程中使用名称来访问对象。
EJB企业级JavaBean (EJB)是用于构建企业应用程序的服务器端可〔管理〕组件。
然而,这个东西在 Spring出来后基本上是凉凉了,知道是什么就行。
外文翻译---JSP的技术发展历史

THE TECHNIQUE DEVELOPMENT HISTORY OF JSPBy:Kathy Sierra and Bert BatesSource:Servlet&JSPThe Java Server Pages( JSP) is a kind of according to web of the script plait distance technique, similar carries the script language of Java in the server of the Netscape company of server- side JavaScript( SSJS) and the Active Server Pages(ASP) of the Microsoft. JSP compares the SSJS and ASP to have better can expand sex, and it is no more exclusive than any factory or some one particular server of Web. Though the norm of JSP is to be draw up by the Sun company of, any factory can carry out the JSP on own system.The After Sun release the JSP( the Java Server Pages) formally, the this kind of new Web application development technique very quickly caused the people's concern. JSP provided a special development environment for the Web application that establishes the high dynamic state. According to the Sun parlance, the JSP can adapt to include the Apache WebServer, IIS4.0 on the market at inside of 85% server product.This chapter will introduce the related knowledge of JSP and Databases, and JavaBean related contents, is all certainly rougher introduction among them basic contents, say perhaps to is a Guide only, if the reader needs the more detailed information, pleasing the book of consult the homologous JSP.1.1 GENERALIZEThe JSP(Java Server Pages) is from the company of Sun Microsystems initiate, the many companies the participate to the build up the together of the a kind the of dynamic the state web the page technique standard, the it have the it in the construction the of the dynamic state the web page the strong but the do not the especially of the function. JSP and the technique of ASP of the Microsoft is very alike. Both all provide the ability that mixes with a certain procedure code and is explain by the language engine to carry out the procedure code in the code of HTML. Underneath we are simple of carry on the introduction to it.JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. However, this underlying equivalence does not mean that servlets and JSP pages are equally appropriate in all scenarios. The issue is not the power of the technology, it is the convenience, productivity, and maintainability of one or the other. After all, anything you can do on a particular computer platform in the Java programming language you could also do in assembly language. But it still matters which you choose.JSP provides the following benefits over servlets alone:• It is easier to write and maintain the HTML. Your static code is ordinary HTML: no extra backslashes, no double quotes, and no lurking Java syntax.• You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simply ignore the JSP tags.• You can divide up your development team. The Java programmers can work on the dynamic code. The Web developers can concentrate on the presentation layer. On large projects, this division is very important. Depending on the size of your team and the complexity of your project, you can enforce a weaker or stronger separation between the static HTML and the dynamic content.Now, this discussion is not to say that you should stop using servlets and use only JSP instead. By no means. Almost all projects will use both. For some requests in your project, you will use servlets. For others, you will use JSP. For still others, you will combine them with the MVC architecture . You want the appropriate tool for the job, and servlets, by themselves, do not complete your toolkit.1.2 SOURCE OF JSPThe technique of JSP of the company of Sun, making the page of Web develop the personnel can use the HTML perhaps marking of XML to design to turn the end page with format. Use the perhaps small script future life of marking of JSP becomes the dynamic state on the page contents.( the contents changes according to the claim of)The Java Servlet is a technical foundation of JSP, and the large Web applies the development of the procedure to need the Java Servlet to match with with the JSP and then can complete, this name of Servlet comes from the Applet, the local translation method of now is a lot of, this book in order not to misconstruction, decide the direct adoption Servlet but don't do any translation, if reader would like to, can call it as" small service procedure". The Servlet is similar to traditional CGI, ISAPI, NSAPI etc. Web procedure development the function of the tool in fact, at use the Java Servlet hereafter, the customer need not use again the lowly method of CGI of efficiency, also need not use only the ability come to born page of Web of dynamic state in the method of API that a certain fixed Web server terrace circulate. Many servers of Web all support the Servlet, even not support the Servlet server of Web directly and can also pass the additional applied server and the mold pieces to support the Servlet. Receive benefit in the characteristic of the Java cross-platform, the Servlet is also a terrace irrelevant, actually, as long as match the norm of Java Servlet, the Servlet is complete to have nothing to do with terrace and is to have nothing to do with server of Web. Because the Java Servlet is internal to provide the service by the line distance, need not start a progressto the each claimses, and make use of the multi-threading mechanism can at the same time for several claim service, therefore the efficiency of Java Servlet is very high.But the Java Servlet also is not to has no weakness, similar to traditional CGI, ISAPI, the NSAPI method, the Java Servlet is to make use of to output the HTML language sentence to carry out the dynamic state web page of, if develop the whole website with the Java Servlet, the integration process of the dynamic state part and the static state page is an evil-foreboding dream simply. For solving this kind of weakness of the Java Servlet, the SUN released the JSP.A number of years ago, Marty was invited to attend a small 20-person industry roundtable discussion on software technology. Sitting in the seat next to Marty was James Gosling, inventor of the Java programming language. Sitting several seats away was a high-level manager from a very large software company in Redmond, Washington. During the discussion, the moderator brought up the subject of Jini, which at that time was a new Java technology. The moderator asked the manager what he thought of it, and the manager responded that it was too early to tell, but that it seemed to be an excellent idea. He went on to say that they would keep an eye on it, and if it seemed to be catching on, they would follow his company's usual "embrace and extend" strategy. At this point, Gosling lightheartedly interjected "You mean disgrace and distend."Now, the grievance that Gosling was airing was that he felt that this company would take technology from other companies and suborn it for their own purposes. But guess what? The shoe is on the other foot here. The Java community did not invent the idea of designing pages as a mixture of static HTML and dynamic code marked with special tags. For example, Cold Fusion did it years earlier. Even ASP (a product from the very software company of the aforementioned manager) popularized this approach before JSP came along and decided to jump on the bandwagon. In fact, JSP not only adopted the general idea, it even used many of the same special tags as ASP did.The JSP is an establishment at the model of Java servlets on of the expression layer technique, it makes the plait write the HTML to become more simple.Be like the SSJS, it also allows you carry the static state HTML contents and servers the script mix to put together the born dynamic state exportation. JSP the script language that the Java is the tacit approval, however, be like the ASP and can use other languages( such as JavaScript and VBScript), the norm of JSP also allows to use other languages.1.3JSP CHARACTERISTICSIs a service according to the script language in some one language of the statures system this kind of discuss, the JSP should be see make is a kind of script language.However, be a kind of script language, the JSP seemed to be too strong again, almost can use all Javas in the JSP.Be a kind of according to text originally of, take manifestation as the central development technique, the JSP provided all advantages of the Java Servlet, and, when combine with a JavaBeans together, providing a kind of make contents and manifestation that simple way that logic separate. Separate the contents and advantage of logical manifestations is, the personnel who renews the page external appearance need not know the code of Java, and renew the JavaBeans personnel also need not be design the web page of expert in hand, can use to take the page of JavaBeans JSP to define the template of Web, to build up a from have the alike external appearance of the website that page constitute. JavaBeans completes the data to provide, having no code of Java in the template thus, this means that these templates can be written the personnel by a HTML plait to support. Certainly, can also make use of the Java Servlet to control the logic of the website, adjust through the Java Servlet to use the way of the document of JSP to separate website of logic and contents.Generally speaking, in actual engine of JSP, the page of JSP is the edit and translate type while carry out, not explain the type of. Explain the dynamic state web page development tool of the type, such as ASP, PHP3 etc., because speed etc. reason, have already can't satisfy current the large electronic commerce needs appliedly, traditional development techniques are all at to edit and translate the executive way change, such as the ASP → ASP+;PHP3 → PHP4.In the JSP norm book, did not request the procedure in the JSP code part( be called the Scriptlet) and must write with the Java definitely. Actually, have some engines of JSP are adoptive other script languages such as the EMAC- Script, etc., but actually this a few script languages also are to set up on the Java, edit and translate for the Servlet to carry out of. Write according to the norm of JSP, have no Scriptlet of relation with Java also is can of, however, mainly lie in the ability and JavaBeans, the Enterprise JavaBeanses because of the JSP strong function to work together, so even is the Scriptlet part not to use the Java, edit and translate of performance code also should is related with Java.1.4JSP MECHANISMTo comprehend the JSP how unite the technical advantage that above various speak of, come to carry out various result easily, the customer must understand the differentiation of" the module develops for the web page of the center" and" the page develops for the web page of the center" first.The SSJS and ASP are all in several year ago to release, the network of that time is still very young, no one knows to still have in addition to making all business, datas and theexpression logic enter the original web page entirely heap what better solve the method. This kind of model that take page as the center studies and gets the very fast development easily. However, along with change of time, the people know that this kind of method is unwell in set up large, the Web that can upgrade applies the procedure. The expression logic write in the script environment was lock in the page, only passing to shear to slice and glue to stick then can drive heavy use. Express the logic to usually mix together with business and the data logics, when this makes be the procedure member to try to change an external appearance that applies the procedure but do not want to break with its llied business logic, apply the procedure of maintenance be like to walk the similar difficulty on the eggshell. In fact in the business enterprise, heavy use the application of the module already through very mature, no one would like to rewrite those logics for their applied procedure.HTML and sketch the designer handed over to the implement work of their design the Web plait the one who write, make they have to double work- Usually is the handicraft plait to write, because have no fit tool and can carry the script and the HTML contents knot to the server to put together. Chien but speech, apply the complexity of the procedure along with the Web to promote continuously, the development method that take page as the center limits sex to become to get up obviously.At the same time, the people always at look for the better method of build up the Web application procedure, the module spreads in customer's machine/ server the realm. JavaBeans and ActiveX were published the company to expand to apply the procedure developer for Java and Windows to use to come to develop the complicated procedure quickly by" the fast application procedure development"( RAD) tool. These techniques make the expert in the some realm be able to write the module for the perpendicular application plait in the skill area, but the developer can go fetch the usage directly but need not control the expertise of this realm.Be a kind of take module as the central development terrace, the JSP appeared. It with the JavaBeans and Enterprise JavaBeans( EJB) module includes the model of the business and the data logic for foundation, provide a great deal of label and a script terraces to use to come to show in the HTML page from the contents of JavaBeans creation or send a present in return. Because of the property that regards the module as the center of the JSP, it can drive Java and not the developer of Java uses equally. Not the developer of Java can pass the JSP label( Tags) to use the JavaBeans that the deluxe developer of Java establish. The developer of Java not only can establish and use the JavaBeans, but also can use the language of Java to come to control more accurately in the JSP page according to the expression logic of the first floor JavaBeans.See now how JSP is handle claim of HTTP. In basic claim model, a claim directly was send to JSP page in. The code of JSP controls to carry on hour of the logic processing and module of JavaBeanses' hand over with each other, and the manifestation result in dynamic state bornly, mixing with the HTML page of the static state HTML code. The Beans can be JavaBeans or module of EJBs. Moreover, the more complicated claim model can see make from is request other JSP pages of the page call sign or Java Servlets.The engine of JSP wants to chase the code of Java that the label of JSP, code of Java in the JSP page even all converts into the big piece together with the static state HTML contents actually. These codes piece was organized the Java Servlet that customer can not see to go to by the engine of JSP, then the Servlet edits and translate them automatically byte code of Java.Thus, the visitant that is the website requests a JSP page, under the condition of it is not knowing, an already born, the Servlet actual full general that prepared to edit and translate completes all works, very concealment but again and efficiently. The Servlet is to edit and translate of, so the code of JSP in the web page does not need when the every time requests that page is explain. The engine of JSP need to be edit and translate after Servlet the code end is modify only once, then this Servlet that editted and translate can be carry out. The in view of the fact JSP engine auto is born to edit and translate the Servlet also, need not procedure member begins to edit and translate the code, so the JSP can bring vivid sex that function and fast developments need that you are efficiently.Compared with the traditional CGI, the JSP has the equal advantage. First, on the speed, the traditional procedure of CGI needs to use the standard importation of the system to output the equipments to carry out the dynamic state web page born, but the JSP is direct is mutually the connection with server. And say for the CGI, each interview needs to add to add a progress to handle, the progress build up and destroy by burning constantly and will be a not small burden for calculator of be the server of Web. The next in order, the JSP is specialized to develop but design for the Web of, its purpose is for building up according to the Web applied procedure, included the norm and the tool of a the whole set. Use the technique of JSP can combine a lot of JSP pages to become a Web application procedure very expediently.JSP的技术发展历史作者:Kathy Sierra and Bert Bates来源:Servlet&JSPJava Server Pages(JSP)是一种基于web的脚本编程技术,类似于网景公司的服务器端Java脚本语言——server-side JavaScript(SSJS)和微软的Active Server Pages(ASP)。
javaEE常用开源框架的认识及概述

javaEE常⽤开源框架的认识及概述对javaEE框架的认识⼀、什么是框架通俗的理解,框架是我们软件开发中的⼀套解决⽅案,不同的框架解决的问题是不同的,⽐如MyBatis框架解决的是持久层的问题,springMVC框架解决的是表现层的问题。
需要注意的是,框架它本⾝⾃⼰是不能实现业务上的功能,它只能对,⽐如说持久层、表现层、结构合理性等等,提供⼀些解决⽅案,⽽真正的业务层部分,还需要程序员⾃⼰来提供。
所以说,框架可以理解为⼀个半成品,我们选⽤这个半成品,然后加上业务需求(即项⽬中的需求)来最终实现整个的功能。
⽽我们使⽤框架的⽬的其实也很简单,就是为了提⾼开发的效率,⽽不⽤关⼼⼀些繁琐的、复杂的底层代码实现,从⽽把更多的精⼒⽤在需求的实现上。
⼆、框架能帮我们解决哪些问题要明⽩框架能解决哪些问题,⾸先要知道三层架构。
三层架构分为三层:表现层:是⽤于展⽰数据的;业务层:是处理业务需求的;持久层:是和数据库交互的。
从这张图可看出上⾯列出的三个框架和三层架构所处的位置。
可以看出MyBatis框架是⼀个持久层框架,它是和数据库交互的;⽽下⾯的Spring框架有点特殊,它不属于任何⼀层;SpringMVC框架是处于表现层的,它是⼀个表现层框架。
从这张图可⼤致得出,不同的框架是各司其职的,它们解决某⼀层或者某⼀类的事情。
三、对⼀些主流框架的认识由于以下具体的框架都没有学过,所以只能说⼀说,我对这些框架的⼤体认识,可能对于某些框架没⽤使⽤过和对⽐过很难对它的优势有深刻的认识,只能在后续的学习中,深⼊理解。
1、Struts2框架Struts2框架处于三层架构的表现层,可以⽤来替代掉Servlet技术,来处理前端访问服务器的请求(如表单、页⾯提交过来的请求),所以Struts2是属于⼀个前端处理的框架。
下图显⽰了Struts2框架在三层架构中的位置:对于web⽇常的⼯作,⽐如获取请求参数、转发、重定向、校验参数等等,使⽤Servlet技术基本都可以完成。
Java中的Web开发框架有哪些

Java中的Web开发框架有哪些在Java中,有多种用于Web开发的框架。
这些框架提供了一套工具和结构,帮助开发人员快速构建可靠、高效的Web应用程序。
本文将介绍几种常用的Java Web开发框架。
一、Spring MVCSpring MVC是一个基于Java的轻量级Web框架,它是Spring框架的一部分。
Spring MVC通过使用模型-视图-控制器(MVC)的设计模式,将应用程序的不同组件分离开来。
它提供了灵活的配置选项和强大的功能,包括请求映射、表单处理、数据验证和视图解析等。
Spring MVC也支持RESTful风格的Web服务开发。
二、StrutsStruts是另一个受欢迎的Java Web框架,它遵循MVC设计模式。
Struts框架提供了一种结构化的方法来构建Web应用程序。
它使用Struts配置文件来管理请求和处理逻辑,同时提供了多种标签库和表单验证机制。
Struts还支持国际化和本地化,使得开发多语言应用程序更加简便。
三、JSFJavaServer Faces(JSF)是Java EE的一部分,它是一种用于构建用户界面的Web框架。
相比于其他框架,JSF更加面向组件。
它提供了一系列可重用的UI组件,开发人员可以通过简单地组合这些组件来构建复杂的用户界面。
JSF还具有良好的可扩展性和集成性,可以轻松地与其他Java技术和框架进行集成。
四、Play框架Play框架是一个用于构建Web应用程序的响应式全栈框架。
它采用了基于Actor模型的异步编程模型,这使得Play应用程序能够处理高并发和高吞吐量的请求。
Play框架还提供了内置的开发工具和自动重新加载功能,使得开发变得更加高效。
此外,Play还支持多种数据库和模板引擎,开发人员可以根据自己的需求进行选择。
五、Spring BootSpring Boot是一个用于简化Spring应用程序开发的框架。
它提供了一种约定优于配置的方式,通过自动配置和快速启动器,可以快速构建独立运行的、生产级别的Spring应用程序。
JavaEE框架详解

JavaEE框架详解JavaEE(Java Enterprise Edition)是一种用于开发大型企业级应用程序的Java平台。
它提供了一整套标准化的API和开发工具,能够满足企业级应用开发的各种需求。
JavaEE框架是基于JavaEE平台的一种软件开发框架,它提供了一系列的组件和工具,可以帮助开发者更加高效、简便地开发和部署JavaEE应用。
本文将对JavaEE框架进行详细解析。
一、JavaEE框架概述JavaEE框架是构建JavaEE应用程序的基础设施。
它提供了一种基于组件的开发模式,开发者可以通过配置和组合不同的组件来构建应用程序。
JavaEE框架提供了一系列的标准化API、工具和解决方案,可以加速应用程序的开发过程。
JavaEE框架主要包括以下几个核心组件:1. Servlet容器:用于处理HTTP请求和响应,基于Servlet规范实现。
2. JSP容器:用于解析和执行JSP页面,基于JSP规范实现。
3. EJB容器:用于管理和执行企业级JavaBean,基于EJB规范实现。
4. JPA提供者:用于持久化Java对象到关系数据库,基于JPA规范实现。
二、常见的JavaEE框架1. Spring框架Spring框架是目前最流行的JavaEE框架之一。
它提供了一系列的模块,包括依赖注入、AOP(面向切面编程)、MVC(模型-视图-控制器)等,可以帮助开发者更加高效地开发JavaEE应用程序。
Spring框架具有良好的可扩展性和灵活性,可以与其他框架无缝集成,被广泛应用于企业级应用开发。
2. Hibernate框架Hibernate是一个强大的对象关系映射(ORM)框架,用于将Java对象映射到关系数据库中的表结构。
它简化了数据库操作的编码工作,提供了一套面向对象的API,可以方便地进行数据库的增删改查操作。
Hibernate框架具有良好的跨数据库兼容性,支持的数据库种类非常丰富,被广泛应用于JavaEE应用程序的数据持久化层。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
外文翻译---J S P技术与主流J A V A+E E开源框架(S S H)技术简介-CAL-FENGHAI-(2020YEAR-YICAI)_JINGBIAN中文3170字本科毕业设计外文翻译JSP technology and mainstream open-source framework for JAVA EE院(系、部)名称:工商管理学院专业名称:信息管理与信息系统学生姓名:学生学号:指导教师:2012年 5月 18日JSP technology and mainstream open-source framework forJAVAEE1.JSP ProfileJSP (Java Server Pages) is initiated by Sun Microsystems, Inc., with many companies to participate in the establishment of a dynamic web page technical standards. JSP technology somewhat similar to ASP technology, it is in the traditional HTML web page document (*.htm, *. html) to insert the Java programming paragraph (Scriptlet) and JSP tag (tag), thus JSP documents (*.jsp). Using JSP development of the Web application is cross-platform that can run on Linux, is also available for other operating systems.JSP technology to use the Java programming language prepared by the category of XML tags and scriptlets, to produce dynamic pages package processing logic. Page also visit by tags and scriptlets exist in the services side of the resources of logic. JSP page logic and web page design and display separation, support reusable component-based design, Web-based application development is rapid and easy.Web server in the face of visits JSP page request, the first implementation of the procedures of, and then together with the results of the implementation of JSP documents in HTML code with the return to the customer. Insert the Java programming operation of the database can be re-oriented websites, in order to achieve the establishment of dynamic pages needed to function.JSP and Java Servlet, is in the implementation of the server, usually returned to the client is an HTML text, as long as the client browser will be able to visit.JSP 1.0 specification of the final version is launched in September 1999, December has introduced 1.1 specifications. At present relatively new is JSP1.2 norms, JSP2.0 norms of the draft has also been introduced.JSP pages from HTML code and Java code embedded in one of the components. The server was in the pages of client requests after the Java code and then will generate the HTML pages to return to the client browser. Java Servlet JSP is the technical foundation and large-scale Web application development needs of Java Servlet and JSP support to complete. JSP with the Java technology easy to use, fully object-oriented, and a platform-independent and secure mainly for all the characteristics of the Internet. JSP technology strength: (1) time to prepare, run everywhere. At this point Java better than PHP, in addition to systems, the code notto make any changes.(2) the multi-platform support. Basically on all platforms of any development environment, in any environment for deployment in any environment in the expansion. Compared ASP / PHP limitations are obvious. (3) a strong scalability. From only a small Jar documents can run Servlet / JSP, to the multiple servers clustering and load balancing, to multiple Application for transaction processing, information processing, a server to numerous servers, Java shows a tremendous Vitality. (4) diver sification and powerful development tools support. This is similar to the ASP, Java already have many very good development tools, and many can be free, and many of them have been able to run on a variety of platforms under. JSP technology vulnerable:(1) and the same ASP, Java is the advantage of some of its fatal problem. It is precisely because in order to cross-platform functionality, in order to extreme stretching capacity, greatly increasing the complexity of the product. (2) Java's speed is class to complete the permanent memory, so in some cases by the use of memory compared to the number of users is indeed a "minimum cost performance." On the other hand, it also needs disk space to store a series of. Java documents and. Class, as well as the corresponding versions of documents.2. J2EE Development FrameworkJava2 Enterprise Edition middleware unified ideology played a significant role. For example, J2EE for distributed transaction management, directory services and messaging services provide a standard programming interface. J2EE-based -Java2Standard Edition (J2SE), successfully access for Java provides a standard relational database.But, as this article "J2EE programming of the lack of support", as mentioned,J2EEplatform does not provide a satisfactory application programming model. Sun and some of the major application server vendors wanted to use the development tools to reduce the complexity of J2EE development, but these tools are no other outstanding JAVA development tools, which have advanced refactoring tools, and. NET platform compared, J2EE tool support appeared to be very inferior.Many J2EE development tools automatically generate the code for the same complex as the tools themselves. In many small-scale J2EE open source community developers chose another way of development - some can be difficult to reduce the development of J2EE development framework, the more popular such as: Struts, Hibernate, and Spring Framework, J2EE project types in many of today they play an important the role.2.1 Spring FrameworkThe Spring Framework is an open source application framework for the Java platform.The first version was written by Rod Johnson who released the framework with the publication of his book Expert One-on-One J2EE Design and Development in October 2002. The framework was first released under the Apache 2.0 license in June 2003. The first milestone release, 1.0, was released in March 2004, with further milestone releases in September 2004 and March 2005. The Spring 1.2.6 framework won a Jolt productivity award and a JAX Innovation Award in 2006. Spring 2.0 was released in October 2006, and Spring 2.5 in November 2007. In December 2009 version 3.0 GA was released. The current version is 3.0.5.The core features of the Spring Framework can be used by any Java application, but there are extensions for building web applications on top of the Java EE platform. Although the Spring Framework does not impose any specific programming model, it has become popular in the Java community as an alternative to, replacement for, or even addition to the Enterprise JavaBean (EJB) model.Modules The Spring Framework comprises several modules that provide a range of services:Inversion of Control container: configuration of application components and lifecycle management of Java objectsAspect-oriented programming: enables implementation of cross-cutting routinesData access: working with relational database management systems on the Java platform using JDBC and object-relational mapping toolsTransaction management: unifies several transaction management APIs and coordinates transactions for Java objectsModel-view-controller: an HTTP and Servlet-based framework providing hooks for extension and customizationRemote Access framework: configurative RPC-style export and import of Java objects over networks supporting RMI, CORBA and HTTP-based protocols including web services (SOAP)Convention-over-configuration: a rapid application development solution for Spring-based enterprise applications is offered in the Spring model.Batch processing: a framework for high-volume processing featuring reusable functions including logging/tracing, transaction management, job processing statistics, job restart, skip, and resource managementAuthentication and authorization: configurable security processes that support a range of standards, protocols, tools and practices via the Spring Security sub-project (formerly Acegi Security System for Spring).Remote Management: configurative exposure and management of Java objects for local or remote configuration via JMXMessaging: configurative registration of message listener objects for transparent message consumption from message queues via JMS, improvement of message sending over standard JMS APIsTesting: support classes for writing unit tests and integration testsInversion of Control container Central to the Spring Framework is its Inversion of Control container, which provides a consistent means of configuring and managing Java objects using callbacks. The container is responsible for managing object lifecycles: creating objects, calling initialization methods, and configuring objects by wiring them together.Objects created by the container are also called Managed Objects or Beans. Typically, the container is configured by loading XML files containing Bean definitions which provide the information required to create the beans.Objects can be obtained by means of Dependency lookup or Dependency injection. Dependency lookup is a pattern where a caller asks the container object for an object with a specific name or of a specific type. Dependency injection is a pattern where the container passes objects by name to other objects, via either constructors, properties, or factory methods.In many cases it's not necessary to use the container when using other parts of the Spring Framework, although using it will likely make an application easier to configure and customize. The Spring container provides a consistent mechanism to configure applications and integrates with almost all Java environments, from small-scale applications to large enterprise applications.The container can be turned into a partially-compliant EJB3 container by means of the Pitchfork project. The Spring Framework is criticized by some as not being standards compliant. However, Spring Source doesn't see EJB3 compliance as amajor goal, and claims that the Spring Framework and the container allow for more powerful programming models.Aspect-oriented programming framework The Spring Framework has its own AOP framework which modularizes cross-cutting concerns in aspects. The motivation for creating a separate AOP framework comes from the belief that it would be possible to provide basic AOP features without too much complexity in either design, implementation, or configuration. The SAOP framework also takes full advantage of the Spring Container.The Spring AOP framework is interception based, and is configured at runtime. This removes the need for a compilation step or load-time weaving. On the other hand, interception only allows for public or protected method execution on existing objects at a join point.Compared to the AspectJ framework, Spring AOP is less powerful but also less complicated. Spring 1.2 includes support to configure AspectJ aspects in the container. Spring 2.0 added more integration with AspectJ; for example, the pointcut language is reused and can be mixed with SpAOP-based aspects. Further, Spring 2.0 added a Spring Aspects library which uses AspectJ to offer common Spring features such as declarative transaction management and dependency injection via AspectJ compile-time or load-time weaving. Spring Source also uses AspectJ for AOP in other Spring projects such as Spring Roo and Spring Insight, with Spring Security also offering an AspectJ-based aspect library.Spring AOP has been designed to make it able to work with cross-cutting concerns inside the Spring Framework. Any object which is created and configured by the container can be enriched using Spring AOP.The Spring Framework uses Spring AOP internally for transaction management, security, remote access, and JMX.Since version 2.0 of the framework, Spring provides two approaches to the AOP configuration:schema-based approach.@AspectJ-based annotation style.The Spring team decided not to introduce new AOP-related terminology; therefore, in the Spring reference documentation and API, terms such as aspect, join point, advice, pointcut, introduction, target object (advised object), AOP proxy, and weaving all have the same meanings as in most other AOP frameworks (particularly AspectJ).Data access framework Spring's data access framework addresses common difficulties developers face when working with databases in applications. Support is provided for all popular data access frameworks in Java: JDBC, iBatis, Hibernate, JDO, JPA, Oracle Top Link, Apache OJB, and Apache Cayenne, among others.For all of these supported frameworks, Spring provides these features:Resource management - automatically acquiring and releasing database resourcesException handling - translating data access related exception to a Spring data access hierarchyTransaction participation - transparent participation in ongoing transactionsResource unwrapping - retrieving database objects from connection pool wrappersAbstraction for BLOB and CLOB handlingAll these features become available when using Template classes provided by Spring for each supported framework. Critics say these Template classes are intrusive and offer no advantage over using (for example) the Hibernate API.. directly. In response, the Spring developers have made it possible to use the Hibernate and JPA APIs directly. This however requires transparent transaction management, as application code no longer assumes the responsibility to obtain and close database resources, and does not support exception translation.Together with Spring's transaction management, its data access framework offers a flexible abstraction for working with data access frameworks. The Spring Framework doesn't offer a common data access API; instead, the full power of the supported APIs is kept intact. The Spring Framework is the only framework available in Java which offers managed data access environments outside of an application server or container. While using Spring for transaction management with Hibernate, the following beans may have to be configured.Transaction management framework Spring's transaction management framework brings an abstraction mechanism to the Java platform. Its abstraction is capable of working with local and global transactions (local transaction does not require an application server).working with nested transactions working with transaction safe points working in almost all environments of the Java platformIn comparison, JTA only supports nested transactions and global transactions, and requires an application server (and in some cases also deployment of applications in an application server).The Spring Framework ships a Platform Transaction Manager for a number of transaction management strategies:Transactions managed on a JDBC ConnectionTransactions managed on Object-relational mapping Units of WorkTransactions managed via the JTA Transaction Manager and User Transaction Transactions managed on other resources, like object databasesNext to this abstraction mechanism the framework also provides two ways of adding transaction management to applications:Programmatically, by using Spring's Transaction TemplateConfiguratively, by using metadata like XML or Java 5 annotationsTogether with Spring's data access framework — which integrates the transaction management framework — it is possible to set up a transactional system through configuration without having to rely on JTA or EJB. The transactional framework also integrates with messaging and caching engines.The BoneCP Spring/Hibernate page contains a full example project of Spring used in conjunction with Hibernate.Model-view-controller framework The Spring Framework features its own MVC framework, which wasn't originally planned. The Spring developers decided to write their own web framework as a reaction to what they perceived as the poor design of the popular Jakarta Struts web framework, as well as deficiencies in other available frameworks. In particular, they felt there was insufficient separation between the presentation and request handling layers, and between the request handling layer and the model.Like Struts, Spring MVC is a request-based framework. The framework defines strategy interfaces for all of the responsibilities which must be handled by a modern request-based framework. The goal of each interface is to be simple and clear so that it's easy for Spring MVC users to write their own implementations if they so choose. MVC paves the way for cleaner front end code. All interfaces are tightly coupled to the Servlet API. This tight coupling to the Servlet API is seen by some as a failure on the part of the Spring developers to offer a high-level abstraction for web-based applications [citation needed]. However, this coupling makes sure that thefeatures of the Servlet API remain available to developers while offering a high abstraction framework to ease working with said API.The Dispatcher Servlet class is the front controller of the framework and is responsible for delegating control to the various interfaces during the execution phases of a HTTP request.The most important interfaces defined by Spring MVC, and their responsibilities, are listed below:Handler Mapping: selecting objects which handle incoming requests (handlers) based on any attribute or condition internal or external to those requests Handler Adapter: execution of objects which handle incoming requestsController: comes between Model and View to manage incoming requests and redirect to proper response. It essentially is like a gate that directs the incoming information. It switches between going into model or view.View: responsible for returning a response to the client. It is possible to go straight to view without going to the model part. It is also possible to go through all three.View Resolver: selecting a View based on a logical name for the view (use is not strictly required)Handler Interceptor: interception of incoming requests comparable but not equal to Servlet filters (use is optional and not controlled by Dispatcher Servlet).Locale Resolver: resolving and optionally saving of the locale of an individual userMultipart Resolver: facilitate working with file uploads by wrapping incoming requestsEach strategy interface above has an important responsibility in the overall framework. The abstractions offered by these interfaces are powerful, so to allow for a set of variations in their implementations, Spring MVC ships with implementations of all these interfaces and together offers a feature set on top of the Servlet API. However, developers and vendors are free to write other implementations. Spring MVC uses the Java java.util.Map interface as a data-oriented abstraction for the Model where keys are expected to be string values.The ease of testing the implementations of these interfaces seems one important advantage of the high level of abstraction offered by Spring MVC. Dispatcher Servlet is tightly coupled to the Spring Inversion of Control container forconfiguring the web layers of applications. However, applications can use other parts of the Spring Framework—including the container—and choose not to use Spring MVC.Because Spring MVC uses the Spring container for configuration and assembly, web-based applications can take full advantage of the Inversion of Control features offered by the container. This framework allows for multi layering. It allows for the code to be broken apart and used more effectively in segments, while allowing the mvc to do the work. It allows for back and forth transmission of data. Some designs are more linear without allowing a forward and backward flow of information. MVC is designed very nicely to allow this interaction. It is used more than just in web design, but also in computer programming. It's very effective for web design. Basically allows a checks and balance system to occur where before being viewed it can be properly examined.Remote access framework Spring's Remote Access framework is an abstraction for working with various RPC-based technologies available on the Java platform both for client connectivity and exporting objects on servers. The most important feature offered by this framework is to ease configuration and usage of these technologies as much as possible by combining Inversion of Control and AOP.The framework also provides fault-recovery (automatic reconnection after connection failure) and some optimizations for client-side use of EJB remote stateless session beans.Convention-Over-Configuration Rapid Application Development Spring Roo is Spring's Convention-over-configuration solution for rapidly building applications in Java. It currently supports Spring Framework, Spring Security and Spring Web Flow, with remaining Spring projects scheduled to be added in due course. Roo differs from other rapid application development frameworks by focusing on: The following diagram represents the Spring Framework Architecture2.2 Struts IntroductionApache Struts From Wikipedia, the free encyclopedia Jump to: navigation, search"Struts" redirects here. For the structural component, see strut. For other meanings, see strut (disambiguation).This article includes a list of references, but its sources remain unclear because it has insufficient inline citations.Please help to improve this article by introducing more precise citations where appropriate.Apache Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a model-view-controller (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top level Apache project in 2005.Design goals and over view in a standard Java EE web application, the client will typically submit information to the server via a web form. The information is then either handed over to a Java Servlet that processes it, interacts with a database and produces an HTML-formatted response, or it is given to a Java Server Pages (JSP) document that inter mingles HTML and Java code to achieve the same result. Both approaches are often considered inadequate for large projects because they mix application logic with presentation and make maintenance difficult.The goal of Struts is to separate the model (application logic that interacts with a database) from the view (HTML pages presented to the client) and the controller (instance that passes information between view and model). Struts provides the controller (a servlet known as ActionServlet) and facilitates the writing of templates for the view or presentation layer (typically in JSP, but XML/XSLT and Velocity are also supported). The web application programmer is responsible for writing the model code, and for creating a central configuration file struts-config.xml that binds together model, view and controller.Requests from the client are sent to the controller in the form of "Actions" defined in the configuration file; if the controller receives such a request it calls the corresponding Action class that interacts with the application-specific model code. The model code returns an "ActionForward", a string telling the controller what output page to send to the client. Information is passed between model and view in the form of special JavaBeans. A powerful custom tag library allows it to read and write the content of these beans from the presentation layer without the need for any embedded Java code.Struts is categorized as a request-based web application framework Struts also supports internationalization by web forms, and includes a template mechanism called "Tiles" that (for instance) allows the presentation layer to be composed from independent header, footer, and content components History The Apache Struts Project was launched in May 2000 by Craig R. McClanahan to provide a standard MVC framework to the Java community. In July 2001, version 1.0 was released.Struts2 was originally known as WebWork 2. After having been developed separately for several years, WebWork and Struts were combined in 2008 to create Struts 2.Competing MVC frameworks Although Struts is a well-documented, mature, and popular framework for building front ends to Java applications, there are other frameworks categorized as "lightweight" MVC frameworks such as Spring MVC, Stripes, Wicket, Play!, and Tapestry. The new XForms standards and frameworks may also be another option to building complex web Form validations with Struts in the future.The WebWork framework spun off from Apache Struts aiming to offer enhancements and refinements while retaining the same general architecture of the original Struts framework. However, it was announced in December 2005 that Struts would re-merge with WebWork. WebWork 2.2 has been adopted as Apache Struts2, which reached its first full release in February 2007.In 2004 Sun launched an addition to the Java platform, called Java Server Faces (JSF). Aside from the original Struts framework, the Apache project previously offered a JSF-based framework called Shale, which was retired in May 2009.In this section we will discuss about Architecture. Struts is famous for its robust Architecture and it is being used for developing small and big software projects.Struts is an open source framework used for developing J2EE web applications using Model View Controller (MVC) design pattern. It uses and extends the Java Servlet API to encourage developers to adopt an MVC architecture. Struts framework provides three key components:A request handler provided by the application developer that is used to mapped to a particular URI. A response handler which is used to transfer the control to another resource which will be responsible for completing the response.A tag library which helps developers to create the interactive form based applications with server pages Learn Struts 2.2.1 framework Struts provides you thebasic infrastructure infra structure for implementing MVC allowing the developers to concentrate on the business logic The main aim of the MVC architecture is to separate the business logic and application data from the presentation data to the user.Here are the reasons why we should use the MVC design pattern They are resuable: When the problems recurs, there is no need to invent a new solution, we just have to follow the pattern and adapt it as necessary. They are expressive: By using the MVC design pattern our application becomes more expressive.1). Model: The model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser.2). View: The view represents the presentation of the application. The view object refers to the model. It uses the query methods of the model to obtain the contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the view's to maintain the consistency in its presentation when the model changes.3). Controller: Whenever the user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller is responsible for directing the appropriate view to the user. In GUIs, the views and the controllers often work very closely together.The Struts framework is composed of approximately 300 classes and interfaces which are organized in about 12 top level packages. Along with the utility and helper classes framework also provides the classes and interfaces for working with controller and presentation by the help of the custom tag libraries. It is entirely on to us which model we want to choose. The view of the Struts architecture is given below:The Struts Controller Components Whenever a user request for something, then the request is handled by the Struts Action Servlet. When the ActionServlet。