【文章內(nèi)容簡介】
client browser does not need any additional software support. ASP programming language is VBScript such scripting language, JSP use is Java, this is both one of the most significant differences. In addition, ASP and JSP more essential difference: two languages in a totally different way engine handling page embedded program code. In the ASP, VBScript code is ASP engines interpret execution。 In the JSP, code has been piled into Java virtual machine by Servlet and execution, the piler operation is only on the JSP page first request happen. (2)Dimension of running environment From the JSP page in from here can also download the JSP specification, these standard defines the supplier in creating JSP engine when must ply to some rules. Execute JSP code needed on the server installation JSP engine. Here we use is from the Development Kit (JavaServer Web JSWDK). To facilitate learning, this package offers a lot for modification examples. JSWDK after installation, just need to perform startserver mand can server. The default configuration server in the port 8080 8 surveillance, use can open default page. In running the JSP sample page before installation, please pay attention to the JSWDK directory, especially schools subdirectories of content. Execute the sample pages, here can see how the JSP page are converted into Java source file, then piled into scaleup file (. Servlet). JSWDK packages examples in the page is divided into two categories, they or JSP files, or is included in a form of HTML files, these forms all by JSP code processing. And as the Java, JSP ASP code are executed on the server. Therefore, in the browser use the view source menu is unable to see the JSP code, can see the results HTML code. All the source code examples are by a single provide examples page. Eclipse is an open source, based on a Java extensible development platform. Eclipse it just a framework and a set of service, used to construct the Development environment through plugins ponents, the key is Eclipse es in a standard plugin sets, including Java Development Tools (Java Development Tools, JDT). The Eclipse is developed by IBM alternative mercial software for the next generation of Java Visual agerelated IDE development environment, November 2021 contribution to the open source munity, now by a nonprofit software vendors alliance Eclipse Foundation (Eclipse Foundation) management. (3)JSP page examples Below we analyze a simple JSP page. You can JSWDK examples in the directory create another directory store this file, the file name can be arbitrary, but extensions must serve. JSP. From the code below the list can see, except the JSP page than ordinary HTML page more Java code outside, both has the same basic structure. Java code is through % and % symbols to join in the middle of the HTML code, its main function is to generate and display a from 0 to 9 string. In the string in the front and rear of the HTML code that some are through the text output. HTML HEAD TITLEJSP PAGE /TITLE /HEAD BODY %@ page language=java % %! String str=0。 % % for (int i=1。 i 10。 i++) { str = str + i。 } % JSP Before out。 P %= str % P 9 JSP After out。 /BODY /HTML The JSP page can be divided into several parts for analysis. First is the JSP instructions. It describes the basic information of the page, such as the use of language, whether to maintain conversation status, whether to use cushion etc. The JSP instructions by % @ beginning, % over. In this example, directive % @ brief language = Java % simply defines this example is using Java language (at present, in the JSP specification in Java is the only support