Skeleton Code
This Magercise shows how to create a very simple servlet, how to host
the servlet with the Java Web ServerTM
(JWS), and how to invoke the servlet from a browser. In this Magercise
all of the code has been written for you.
To review the course material for this exercise go to the
course
notes.
Perform the following tasks:
Compile the HelloWorldServlet2.java file using
your favorite Java compiler.
Move the servlet to the default servlet directory for the JWS. For
JWS version 1.1, the default location on a Windows platform is
C:\JavaWebServer1.1\servlets
Run the JWS.
Use the JWS Servlet Management panel to install the servlet and
create the alias HW2.
Activate the servlet from your browser by clicking
here
or by typing the URL
http://localhost:8080/servlet/HelloWorldServlet2
into your browser.
Activate the servlet from your browser by using the alias, HW2,
by clicking here
or by typing the URL
http://localhost:8080/servlet/HW2
into your
browser.
The task numbers above are linked to the
step-by-step
help page. Also available
is
a complete solution to the
problem, and a demonstration
of the expected behavior.
When you finish this Magercise you will have successfully installed
a servlet in the Java Web Server and activated it from a browser. You
have also created an alias for the servlet and used the alias to access
the servlet.
Copyright © 1998 MageLang
Institute.
All Rights Reserved.
|