Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

1. Intro and Overview: Why use Servlets ... > Servlets Demystified (write, deploy,...

Servlets Demystified (write, deploy, run)

Just so those new to servlets can stop holding their breath, here’s a quick guide to writing, deploying, and running a servlet. This might create more questions than it answers—don’t panic, you don’t have to do this right now. It’s just a quick demonstration for those who can’t wait. The next chapter includes a more thorough tutorial.

  1. Build this directory tree (somewhere not under tomcat).

    image with no caption
  2. Write a servlet named Ch1Servlet.java and put it in the src directory (to keep this example simple, we aren’t putting the servlet in a package, but after this, all other servlet examples in the book will be in packages).

    image with no caption
  3. Create a deployment descriptor (DD) named web.xml, put it in the etc directory

    image with no caption
  4. Build this directory tree under the existing tomcat directory...


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint