计算机外文翻译---jsp应用框架-jsp程序(编辑修改稿)内容摘要:
verhead. Servlet developers can use the init() method to hold references to expensive resources, such as database connections or EJB Home Interfaces, so that they can be shared between requests. Acquiring resources like these can take several seconds— which is longer than many surfers are willing to wait. The other edge of the sword is that, since servlets are multithreaded, servlet developers must take special care to be sure their servlets are threadsafe. To learn more about servlet programming, we remend Java Servlets by Example, by Alan R. Williamson [Williamson]. The definitive source for Servlet information is the Java Servlet Specification [Sun, JST]. JavaServer Pages: 6 While Java servlets are a big step up from CGI programs, they are not a panacea. To generate the response, developers are still stuck with using println statements to render the HTML. Code that looks like: (POne line of HTML./P)。 (PAnother line of HTML./P)。 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 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。 mutators are used to change a JavaBean’s state. Mutators are always prefixed with lowercase token set followed by the property name. The first character in the property name must be uppercase. The return value is always void— mutators only change property values。 they do not retrieve them. The mutator for a simple property takes only one parameter in its signature, which can be of any type. Mutators are often nicknamed setters after their prefix. The mutator method signature for a weight property of the type Double would be: public void setWeight(Double weight) A similar design pattern is used to create the accessor method signature. Accessor methods are always prefixed with the lowercase token get, followed by the property name. The first character in the property name must be uppercase. The return value will match the method parameter in the corresponding mutator. Accessors for simple properties cannot accept parameters in their method signature. Not surprisingly, accessors are often called getters. The accessor method signature for our weight property is: public Double getWeight() If the accessor returns a logical value, there is a variant pattern. Instead of using the lowercase token get, a logical property can use the prefix is, followed by the property name. The fir。计算机外文翻译---jsp应用框架-jsp程序(编辑修改稿)
相关推荐
cturer , resulting in what are known as formatted disks. Most puter systems can also perform this task. Thus, if the format information on a disk is damaged, the disk can be reformatted, although
. JavaBeans pletes 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
niputers”had dll of the characteristics of full scale puters,but they were smaller and considerably less smaller puters called microputers followed soon after. The 1970’s saw continued advances in
如何撰写商业计划书(经典) 如何撰写商业计划书(经典)可以这样说,商业计划书首先是把计划中要创立的企业推销给风险企业家自己。 其次,商业计划书还能帮助把计划中的风险企业推销给风险投资家,公司商业计划书的主要目的之一就是为了筹集资金。 因此,商业计划书必须要说明: (1)创办企业的目的 精力、时间、资源、资金去创办风险企业? (2)创办企业所需的资金什么投资人值得为此注入资金?
tocol on development workstation, and OEMPreDownload( ) can obtain an IP address through DHCP, otherwise, it would assign a static address. OEMPreDownload( ) calls EbootInitEtherTransport( ) to
c operate the java code for the pilation the procedure to provide the formidable function reflection, this function was JavaBeans is specially useful, the use reflected Java to be able to support the