Page #475 (35.2. A Simple JSP Page)

 
[Page 1211]

35.3. How Is a JSP Page Processed ?

A JSP page must first be processed by a Web server before it can be displayed in a Web browser. The Web server must support JSP, and the JSP page must be stored in a file with a .jsp extension. The Web server translates the .jsp file into a Java servlet, compiles the servlet, and executes it. The result of the execution is sent to the browser for display. Figure 35.2 shows how a JSP page is processed by a Web server. CurrentTime.jsp in Figure 35.1 is translated into a servlet named CurrentTime_jsp.java in c:\jakarta-tomcat-5.5.9\work\standalone\localhost\liangweb . Viewing the file will help you to better understand that JSP is based on the servlet.

Figure 35.2. A JSP page is translated into a servlet.

Note

A JSP page is translated into a servlet when the page is requested for the first time. It is not retranslated if the page is not modified. To ensure that the first-time real user does not get a delay, JSP developers may test the page after it is installed.


 


Introduction to Java Programming-Comprehensive Version
Introduction to Java Programming-Comprehensive Version (6th Edition)
ISBN: B000ONFLUM
EAN: N/A
Year: 2004
Pages: 503

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net