【正文】
g web applications. When Sun engineers developed the JSP tag extension classes, they designed them to work with JavaBeans. The dynamic data for a page can be passed as a JavaBean, and the JSP tag can then use the bean’s properties to customize the output. For more on JavaBeans, we highly remend The Awesome Power of JavaBeans, by Lawrence H. Rodrigues [Rodrigues]. The definitive source for JavaBean information is the JavaBean Specification [Sun, JBS]. Model 2: The release of the Servlet/JSP Specification described Model 2 as an architecture that uses servlets and JSP pages together in the same application. The term Model 2 disappeared from later releases, but it remains in popular 。 is all too mon in servlets that generate the HTTP response. There are libraries that can help you generate HTML, but as applications grow more plex, Java developers end up being cast into the role of HTML page designers. Meanwhile, given the choice, most project managers prefer to divide development teams into specialized groups. They like HTML designers to be working on the presentation while Java engineers sweat the business logic. Using servlets alone encourages mixing markup with 大連交通大學(xué) 2020 屆本科生畢業(yè)設(shè)計(論文)外文翻譯 10 business logic, making it difficult for team members to specialize. To solve this problem, Sun turned to the idea of using server pages to bine scripting and templating technologies into a single ponent. To build Java Server Pages, developers start by creating HTML pages in the same old way, using the same old HTML syntax. To bring dynamic content into the page, the developer can also place JSP scripting elements on the page. Scripting elements are tags that encapsulate logic that is recognized by the JSP. You can easily pick out scripting elements on JSP pages by looking for code that begins with % and ends with %. To be seen as a JSP page, the file just needs to be saved with an extension of .jsp. When a client requests the JSP page, the container translates the page into a source code file for a Java servlet and piles the source into a Java class file— just as you would do if you were writing a servlet from scratch. At runtime, the container can also check the last modified date of the JSP file against the class file. If the JSP file has changed since it was last piled, the container will retranslate and rebuild the page all over again. Project managers can now assign the presentation layer to HTML developers, who then pass on their work to Java developers to plete the businesslogic portion. The important thing to remember is that a JSP page is really just a servlet. Anything you can do with a servlet, you can do with a JSP. 7. JavaBeans: JavaBeans are Java classes which conform to a set of design patterns that make them easier to use with development tools and other ponents. DEFINITION A JavaBean is a reusable software ponent written in Java. To qualify as a JavaBean, the class must be concrete and public, and have a noargument constructor. JavaBeans expose internal fields as properties by providing public methods that follow a consistent design pattern. Knowing that the property names follow this pattern, other Java classes are able to use introspection to discover and manipulate JavaBean properties. The JavaBean design patterns provide access to the bean’s internal state through two flavors of methods: accessors are used to read a JavaBean’s state。 those tags are processed on the server and are not part of the output that is sent to the client. Confusing Translation Time with Request Time A JSP page is converted into a servlet. The servlet is piled, loaded into the server39。s Java version— the server39。t understand how JSP works without understanding servlets. 2. JSP consists of static HTML, specialpurpose JSP tags, and Java code. What kind of Java code? Servlet code! You can39。s 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, JSP has a clear advantage for the dynamic code. With JSP, the dynamic part is written in Java, not VBScript or another ASPspecific language, so JSP is more powerful and better suited to plex applications that require reusable ponents. You could make the same argument when paring JSP to the previous version of ColdFusion。大連交通大學(xué) 2020 屆本科生畢業(yè)設(shè)計(論文)外文翻譯 1 外文原文 Overview of JSP Technology and JSP application frameworks Autor: Zambon Giulio/ Sekler Michael Source: SpringerVerlag New York Inc 1. Benefits of JSP JSP pages are translated into servlets. So, fundamentally, any task JSP pages can perform could also be acplished 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 puter platform in the Java programming language you could also do in assembly language. But it still matters which you 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 Website 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 plexity of your project, you can enforce a weaker or stron