How JavaServer Pages Works

   

Java™ 2 Primer Plus
By Steven Haines, Steve Potts

Table of Contents
Chapter 22.  JavaServer Pages (JSP)


You, the programmer, create JSP using your editor of choice. Anything from vi to Forte will work. You place JSP in a special directory where the Web server can find it. The user types in the name of the JSP just like he would type the name of a servlet.

When the request arrives at the Web server, the server translates the JSP page into a servlet and runs that servlet. From that point forward until the server is shut down, the server will submit subsequent requests directly to the servlet and bypass the JSP.

If the JSP has been modified, or if the server unloaded it because of lack of use, the translation step is repeated. Concurrent access to the JSP-generated servlet is handled by threading the requests just as it is in ordinary servlets. Figure 22.1 shows this process graphically.

Figure 22.1. The JSP is translated into a servlet prior to being run by the Web server.

graphics/22fig01.gif

The end result of this process is HTML being displayed on a browser.


       
    Top
     



    Java 2 Primer Plus
    Java 2 Primer Plus
    ISBN: 0672324156
    EAN: 2147483647
    Year: 2001
    Pages: 332

    Similar book on Amazon

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