Sun Java Solaris Communities My SDN Account Join SDN
 
Tutorials & Code Camps

Hosting with the Java Web Server

 

Training Index


[Help | Solution | API Docs | Expected Output | Course Notes | Magercises | Module Intro]

Skeleton Code

This Magercise shows how to create a very simple servlet, how to host the servlet with the Java Web Server (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:

  1. Compile the HelloWorldServlet2.java file using your favorite Java compiler.
  2. 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
    
  3. Run the JWS.
  4. Use the JWS Servlet Management panel to install the servlet and create the alias HW2.
  5. Activate the servlet from your browser by typing the URL
    http://localhost:8080/servlet/HelloWorldServlet2
    
    into your browser.
  6. Activate the servlet from your browser by using the alias, HW2, 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.