Technical Support
Discussion Forum
Online Training
Technical Articles
Bug Parade
JDC Resources
DukeDollars
Early Access Toolbar

Java Cup Logo
java.sun.com


Solaris Developer Connection

JDC Home Page

Log Out

Online Training
shadowSearchFAQFeedback

Training Index

Fundamentals of JavaTM Servlets: Magercises
Hosting with the Java Web Server

By MageLang Institute

[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 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:

  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 clicking here or 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 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.





Questions?
8-Jan-99
Copyright © 1996-1998 Sun Microsystems Inc.
All Rights Reserved. Legal Terms. Privacy Policy.
Sun Logo