client. Confusing Translation Time with Request Time A JSP page is converted into a servlet. The servlet is compiled, loaded into the server's memory, initialized, and executed. But which step happens when? To answer that question, remember two points: • The JSP page is translated into a servlet and compiled only the first time it is accessed after having been modified. • Loading into memory, initialization, and execution follow the normal rules for servlets. Table 1 gives some common scenarios and tells whether or not each step occurs in that scenario. The most frequently misunderstood entries are highlighted. When referring to the table, note that servlets resulting from JSP pages use the _jspService method (called for both GET and POST requests), not doGet or doPost. Also, for initialization, they use the jspInit method, not the init method. Table 1. JSP Operations in Various Scenarios JSP page translated into servlet Servlet compiled Servlet loaded into server's memory jspInit called _jspService called Page first written Request 1 Yes Yes Yes Yes Yes Request 2 No No No No Yes Server restarted Request 3 No No Yes Yes Yes Request 4 No No No No Yes Page modified Request 5 Yes Yes Yes Yes Yes Request 6 No No No No Yes
中文翻译 JSP技术概述 一、JSP的好处 JSP页面最终会转换成servler。因而,从根本上,JSP页面能够执行的任何任务都可以用servler来完成。然而,这种底层的等同性并不意味着servler和JSP页面对于所有的情况都等同适用。问题不在于技术的能力,而是二者在便利性、生产率和可维护性上的不同。毕竟,在特定平台上能够用Java编程语言完成的事情,同样可以用汇编语言来完成,但是选择哪种语言依旧十分重要。 和单独使用servler相比,JSP提供下述好处: JSP中HTML的编写与维护更为简单。JSP中可以使用常规的HTML:没有额外的反斜杠,没有额外的双引号,也没有暗含的Java语法。 = 上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页 毕业设计外文翻译来自于论文先生网,如该文注明了作者及出处,请在转载引用时保留。否则因《毕业设计外文翻译》一文引起的法律纠纷请自负。 |