ContentsQuick StartGetting the environment set up
Previous: Quick Start | Next: "Hello World!" - as a web page

Getting the environment set up

Here's the stuff you'll need at a minimum:

For the tutorial, I'm using JBuilder3 on Windows with JSDK2.0 because I think that's how most people are set up (not because I think it's the best environment to develop in ;-) It doesn't - and shouldn't - matter what OS or IDE or (for the tutorial) what version of the JVM is in use! You should know, however, that I've had problems using MSIE5 with PDF on localhost servlets due to what appears to be a caching issue.

Setting up the servlet environment goes something like this:

  1. Install your favorite JDK/IDE on your development machine
  2. Install the JSDK on your server (which may also be the development machine)
  3. Test the installation of the JSDK
  4. If you are using a separate web server, configure it for servlets - you can just use the servletrunner that comes in the JSDK for the tutorial, but be aware that you'll soon outgrow it for real world applications
  5. Test the configuration of the web server by using your web browser to view one of the example servlets included in the JSDK
  6. Configure your JDK/IDE for the JSDK
  7. Compile a simple servlet (such as a slight modification of the SimpleServlet that comes with the JSDK)
  8. Test the simple servlet by viewing it in your web browser
  9. Download and install the servlet utilities (if you are using JDK1.1.x , installation means itemizing the sutlcls11.jar file in your classpath, with JDK1.2 up installation means putting the sutlcls11.jar file in the jre/lib/ext directory)

Note that the steps you just followed tests whether or not you read the "Reader Assumptions" section in the Introduction (and if you were honest in your self-evaluation).

Assuming you want to use JBuilder3, here are the specific steps:

  1. Install JBuilder3 into c:\JBuilder3 - it includes the Java2 JVM and JSDK.
  2. Start a new project - I called mine "sututor"
  3. Use File->New->Servlet, and create a new servlet class called "hello1" - check the "Generate doGet method" and uncheck the other options, then use the Finish button
  4. Hit the F9 key, or use the Run menu - this will start a DOS window with a servlet runner in it
  5. Use your web browser to go to "http://localhost:8080/servlet/sututor.hello1" - you should have a blank screen, except that the browser title (at the very top of the browser window) will say "hello1"
  6. Control-C the ServletRunner window
  7. Add this line to the doGet() method of hello1, between the "<body>" and the "</body></html>" println statements:
  8. Run the servlet again
  9. Hit the refresh button in your browser... again... more... more... OK, don't wear it out :-)
  10. Download and install the servlet utilities (since you are using JBuilder3 , installation means using the "Libraries..." button on the "Project Properties" dialog box to make a JBuilder library entry, and then the "Add..." button to reference the new library in your project)

ContentsQuick StartGetting the environment set up
Previous: Quick Start | Next: "Hello World!" - as a web page