JSP技术概述与应用框架外文翻译(共21页).doc
《JSP技术概述与应用框架外文翻译(共21页).doc》由会员分享,可在线阅读,更多相关《JSP技术概述与应用框架外文翻译(共21页).doc(21页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上外文原文Overview of JSP Technology and JSP application frameworksAutor: Zambon Giulio/ Sekler MichaelSource: Springer-Verlag New York Inc1 Benefits of JSP JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be accomplished by servlets. Howeve
2、r, 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 platf
3、orm 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 l
4、urking 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
5、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 usin
6、g 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
7、 themselves, do not complete your toolkit.2.Advantages of JSP Over Competing Technologies 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
8、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 m
9、anager 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 companys usual embrace and extend strategy. At this point, Gosling lightheartedly interjected You
10、 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
11、 as a mixture of static HTML and dynamic code marked with special tags. For example, ColdFusion 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 n
12、ot only adopted the general idea, it even used many of the same special tags as ASP did.So, the question becomes: why use JSP instead of one of these other technologies? Our first response is that we are not arguing that everyone should. Several of those other technologies are quite good and are rea
13、sonable options in some situations. In other situations, however, JSP is clearly better. Here are a few of the reasons.2.1 Versus .NET and Active Server Pages (ASP). NET is well-designed technology from Microsoft. ASP.NET is the part that directly competes with servlets and JSP. The advantages of JS
14、P are two fold.First, JSP is portable to multiple operating systems and Web servers; you arent locked into deploying on Windows and IIS. Although the core .NET platform runs on a few non-Windows platforms, the ASP part does not. You cannot expect to deploy serious ASP.NET applications on multiple se
15、rvers and operating systems. For some applications, this difference does not matter. For others, it matters greatly.Second, for some applications the choice of the underlying language matters greatly. For example, although .NETs C# language is very well designed and is similar to Java, fewer program
16、mers are familiar with either the core C# syntax or the many auxiliary libraries. In addition, many developers still use the original version of ASP. With this version, JSP has a clear advantage for the dynamic code. With JSP, the dynamic part is written in Java, not VBScript or another ASP-specific
17、 language, so JSP is more powerful and better suited to complex applications that require reusable components. You could make the same argument when comparing JSP to the previous version of ColdFusion; with JSP you can use Java for the real code and are not tied to a particular server product. Howev
18、er, the current release of ColdFusion is within the context of a J2EE server, allowing developers to easily mix ColdFusion and servlet/JSP code.2.2 Versus PHP PHP (a recursive acronym for PHP: Hypertext Preprocessor) is a free, open-source, HTML-embedded scripting language that is somewhat similar t
19、o both ASP and JSP. One advantage of JSP is that the dynamic part is written in Java, which already has an extensive API for networking, database access, distributed objects, and the like, whereas PHP requires learning an entirely new, less widely used language. A second advantage is that JSP is muc
20、h more widely supported by tool and server vendors than is PHP.2.3 Versus Pure Servlets JSP doesnt provide any capabilities that couldnt, in principle, be accomplished with servlets. In fact, JSP documents are automatically translated into servlets behind the scenes. But it is more convenient to wri
21、te (and to modify!) regular HTML than to use a zillion println statements to generate the HTML. Plus, by separating the presentation from the content, you can put different people on different tasks: your Web page design experts can build the HTML by using familiar tools and either leave places for
22、your servlet programmers to insert the dynamic content or invoke the dynamic content indirectly by means of XML tags.Does this mean that you can just learn JSP and forget about servlets? Absolutely not! JSP developers need to know servlets for four reasons: 1. JSP pages get translated into servlets.
23、 You cant understand how JSP works without understanding servlets. 2. JSP consists of static HTML, special-purpose JSP tags, and Java code. What kind of Java code? Servlet code! You cant write that code if you dont understand servlet programming. 3. Some tasks are better accomplished by servlets tha
24、n by JSP. JSP is good at generating pages that consist of large sections of fairly well structured HTML or other character data. Servlets are better for generating binary data, building pages with highly variable structure, and performing tasks (such as redirection) that involve little or no output.
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- JSP 技术 概述 应用 框架 外文 翻译 21
限制150内