Java Reference
In-Depth Information
Display 19.15
Running a Java Applet
C
C
S
C
Internet
1
Request
Web Server
Web Browser
2
HTML + Applet
3
Java VM
The client's Web browser sends a request to the server for a
Web page with a Java applet.
1
The server sends the HTML for the Web page and applet class
files to the client.
2
The client runs the applet using the Java Virtual Machine and
displays its output in the Web browser.
3
Display 19.16
Running a Java Servlet
C
C
S
C
Internet
1
Request
Web Server
Web Browser
HTML
2
HTML
3
Servlet
Engine
The client's Web browser sends a request to the server for a Web
page that runs a Java servlet.
1
The Web server instructs the servlet engine to execute the requested
servlet, which consists of running precompiled Java code. The
servlet outputs HTML that is returned to the Web server.
2
The Web server sends the servlet's HTML to the client's Web browser
to be displayed.
3
the corresponding HTML and is compiled “on the fly” into a servlet when the page
is requested. This flexibility can make it easier to develop Web applications using JSP
than with Java servlets. Displays 19.15 , 19.16 , and 19.17 illustrate the differences for a
website that runs an applet, servlet, or JSP.
 
 
Search WWH ::




Custom Search