1、JSP technology and benefitsJSP technology and benefitsJSP IntroductionJSP (Java Server Pages) is a Java-based scripting technology. Is advocated by Sun Microsystems Inc., together with a number of companies involved in the establishment of a dynamic web page technology standard. JSP technology is so
2、mewhat similar to ASP technology, It is a traditional HTML page file (*. htm, *. html) to insert Java program segment (Scriptlet) and JSP tag (tag), to form the JSP file(*jsp). Web development with JSP is a cross-platform application that can run under Linux, but also in other operating systems. In
3、the JSP of the many advantages, one of which is that it will be HTML encoded Web page from the business logic separated effectively. JSP access with reusable components, such as Servlet, JavaBean and Java-based Web applications. JSP also supports directly in the Web page embedded Java code. JSP can
4、be used two ways to access documents: JSP documents sent by the browser request, the request sent to the Servlet. JSP technology uses Java programming language, XML-type tags and scriptlets, to have a package deal with the logic of dynamic pages. Page tags and scriptlets can also exist in the server
5、 access to the resources of the application logic. JSP logic and Web page design and display isolated and support reusable component-based design, Web-based applications more quickly and easily developed.The Web server when meets visits the JSP homepage the request, first carries out segment, will t
6、hen carry out the result code to return together with JSP in the document HTML for the customer. The insertion Java segment may operate the database, again the directional homepage and so on, realizes the function which the establishment dynamic homepage needs. JSP and Java Servlet are the same, is
7、in the server end execution, usually returns to this client side is a HTML text, therefore client side, so long as has the browser to be able to glance over.The JSP page is composed of the HTML code and the inserting Java code. The server in the page by the client side was requested that later will
8、carry on processing to these Java code, will then produce the HTML page will return gives the client side the browser. Java Servlet is the JSP technology base, moreover the large-scale Web application procedures development needs Java Servlet and the JSP coordination can complete. JSP had the Java t
9、echnology simply easy to use, complete object-oriented, had the platform independency, and safe reliable, mainly faced Internets all characteristics.JSP computing techniqueTo carry on the dynamic website conveniently fast the development, JSP has made the improvement in the following several aspects
10、, causes it to become builds the cross platform fast the dynamic website first choice plan.1. carries on the content production and the demonstration separatesWith the JSP technology, the Web page development personnel may use HTML or the XML marking design and the formatted final page, and uses the
11、 JSP marking or the tootsy produces on pages dynamic content originally. Production contents logic is sealed in marks and in the JavaBeans module, and ties up in the script, all scripts in server end movement. Because core logic is sealed in marks and in JavaBeans, therefore the Web administrative p
12、ersonals and the page designer, can edit and use the JSP page, but does not affect the content the production. In the server end, the JSP engine explained that the JSP marking and the script, produce the content which requested, and (or XML) pages form transmits the result by HTML the browser. This
13、both are helpful in the author protects own code, and can guarantee any based on the HTML Web browsers complete usability.2. may entrust with heavy responsibility the moduleThe overwhelming majority JSP page relies on may entrust with heavy responsibility, the cross platform module (JavaBeans or Ent
14、erprise the JavaBeans module) carries out complex processing which the application procedure requests. The development personnel can share and exchange the execution ordinary operation the module, or causes these modules uses for more users and the customer association. Has accelerated the overall d
15、evelopment process based on modules method, and causes each kind of organization obtains balanced in their existing skill and in the optimized result development endeavor.3. uses markingThe Web page development personnel will not be the familiar script language programmers. The JSP technology has se
16、aled many functions, these functions are easy to use, marking to carry on the dynamic content production with JSP in the related XML to need. The standard JSP marking can visit and the instantiation JavaBeans module, the establishment or the retrieval module attribute, downloads Applet, as well as t
17、he execution difficulty with codes and the time-consuming function with other methods.4. adapts the platformNearly all platforms support Java, JSP+JavaBeans to be possible to pass unimpeded nearly under all platforms. Transplants from a platform to other platform, JSP and JavaBeans does not even nee
18、d to translate, because the Java byte code is standard has nothing to do with the platform.5. database connectionIn Java connects the database the technology is the JDBC, Java procedure is connected through the JDBC driver and the database, operations and so on execution inquiry, extraction data. Su
19、n Corporation has also developed JDBC-ODBC bridge, uses this technical Java procedure to be possible to visit has the ODBC driver database, at present the majority database systems have the ODBC driver, therefore the Java procedure can visit such as Oracle, Sybase, MS SQL Server and databases and so
20、 on MS Access. In addition, through the development marking storehouse, the JSP technology may further expand. The third party development personnel and other personnel may found their marking storehouse for the commonly used function. This enables the Web page development personnel to be able to us
21、e the familiar tool and to be similar to marking same carries out the specific function component to carry on the work. The JSP technology very easy conformity to many kinds of application architecture, to use the extant tool and the skill, and can expand to the support enterprise distributional app
22、lication.Benefits of JSP(1)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.(2)You can use standard Web-site development tools. Even HTML tools that know nothing about JSP can be used because they simpl
23、y ignore the JSP tags.(3)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
24、, you can enforce a weaker or stronger separation between the static HTML and the dynamic content.Advantages of JSP over Competing Technologies 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 ru
25、ns on a few non-Windows platforms, the ASP part does not. You cannot expect to deploy serious ASP.NET applications on multiple servers and operating systems. For some applications, this difference does not matter. For others, it matters greatly.Second, for some applications the choice of the underly
26、ing language matters greatly. For example, although .Nets C# language is very well designed and is similar to Java, fewer programmers 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, JS
27、P has a clear advantage for the dynamic code. With JSP, the dynamic part is written in Java, not VBScript or another ASP-specific language, so JSP is more powerful and better suited to complex applications that require reusable components.Versus PHP,PHP (a recursive acronym for PHP: Hypertext Prepro
28、cessor) is a free, open-source, HTML-embedded scripting language that is somewhat similar to 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
29、 learning an entirely new, less widely used language. A second advantage is that JSP is much more widely supported by tool and server vendors than is PHP.Versus Pure Servlets,JSP doesnt provide any capabilities that couldnt, in principle, be accomplished with servlets. In fact, JSP documents are aut
30、omatically translated into servlets behind the scenes. But it is more convenient to write (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
31、 design experts can build the HTML by using familiar tools and either leave places for your servlet programmers to insert the dynamic content or invoke the dynamic content indirectly by means of XML tags.Security of JSPJSP and other PHP, ASP not the same working mechanism, although it is also a web
32、programming language. The first call to a JSP file is compiled to Servlet implementation process. We wanted to do things, so that before the JSP is compiled by the browser as a text or other documents sent to the client, or when not loaded in the JSP implementation of the compiled JSP Servlet read t
33、he content directly sent to the customer end. JSP is compiled to Servlet saved in the specified directory, such as: lovehacker/index. jsp is likely to be stored in X: IBMWAServer empdefault_hostdefault_ apppagecompile _lovehacker_index_xjsp.class , which is already compiled index.jsp. _ lovehacker_index_xjsp.
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1