【正文】
code. Compared with the PHP PHP ( PHP: Hypertext Preprocessor recursive acronym) is a free, open source, HTML embedded scripting language which, with ASP and JSP are similar to some extent. One advantage of JSP is a dynamic part of the preparation to use Java, but Java has been in working, database access, distributed objects, etc. have a wide range of API, and PHP need to learn new, application of a relatively wide range of languages. The second advantage of JSP, and PHP parison, JSP has a very wide range of tools and server providers. Compared with pure Servlet In principle, JSP and Servlet do not provide the function can not be pleted. In fact, JSP documents are automatically converted in the background Servlet. But the writing (and modify) the conventional HTML, than the numerous println statements to generate the HTML easier. In addition, by separating content that can be assigned to different people for different tasks: Web designers to use familiar tools to build HTML, or leave space for Servlet programmers insert dynamic content, or indirectly through the XML tags called dynamic content. Does this mean that you can only learn JSP, the Servlet threw the side of it? Of course not! For the following four kinds of reasons, JSP developers need to understand the Servlet: (1) JSP page is converted into a Servlet. Servlet can not know JSP do not understand how they work. (2) JSP from a static HTML, special JSP tags and Java code. What type of Java code to do? Servlet code of course! If you do not understand the Servlet programming, you can not write this code. (3) The number of tasks pleted with the Servlet to perform better than using JSP. JSP is generated by a large number of well organized and good at the structure of HTML or any other character data consisting of the page. Servlet good at generating binary data, building structure, a variety of pages, as well as the implementation of the output with little or no output task (for example, redirection). (4) Some tasks are more suited to be used in bination Servlet and JSP to plete, rather than alone Servlet or JSP. Compared with the JavaScript JavaScript and Java programming language are two different things, the former are generally used for the client dynamically generate HTML, the browser load a document to build part of a page. This is a useful function, general and JSP functionality (only running on the server side) does not overlap. Like conventional HTML pages, JSP pages can still include the SCRIPT tag for JavaScript. In fact, JSP or even can be used to dynamically generate to send to the client JavaScript. Thus, JavaScript is not a peting technology, it is a plementary technology. JavaScript can also be used on the server side, the most individualized attention is SUN ONE (former iPla), IIS, and BroadVision server. However, Java is more powerful, flexible, reliable and portable. Compared with the WebMacro and Velocity JSP by no means perfect. Many people have pointed out in the JSP can be improved features. This is a good thing, JSP39。s JSP and Servlet technology, the tremendous support of these two technologies have made tremendous progress, thereby reducing many of the criticisms of the JSP. For example, JSP Standard Tag Library, and JSP expression language to solve the two of the most widespread criticism: the lack of good iterative structure。s output did not arise. Confusion during the conversion period and the request JSP pages need to convert into a servlet. In the piled Servlet, load content to the server, initialize and execute. But every step of what happened when? To answer this question, we must remember the following two points: ? JSP page is only in the revised first time visit, will be converted into a servlet and pil