Document last updated 8 April, 2001. We are very interested in feedback that would make these materials better. Feel free to write the author, Jonathan Revusky.
Este documento en españolThis directory contains a primitive guestbook servlet. This second example explores some more of the possibilities that the template system offers. It is assumed that you have successfully completed the first tutorial example, "Hello, Niggle", having gone through the concrete steps of getting the servlet to work and then reading the accompanying explanatory notes.
If you did manage to build and run the "Hello, Niggle" example, you should
have no problem with this example. You can reuse the same niggletut
web application context that you created then. What you need to do is:
Now, assuming that your servlet server is running, you should be able to try out the servlet. Assuming that you are using Tomcat in its default out-of-the-box configuration, you should be able to open the URL:
http://localhost:8080/niggletut/servlet/GuestbookServlet
At this point, feel free to play around with the example. Though this servlet is still nothing to write home about, it is somewhat more interesting than the "hello, niggle" was. I should point out right now that this example is lacking a major first-order feature: persistence. All of the data is kept in memory, so when you restart the servlet, it loses all the guestbook entries it had. So we still have a certain ways to go before we have anything resembling a "serious" application. Patience! Our next example, the mini-rolodex, will deal with persistence, as well as issues like data validation, and will start taking on the trappings of a real-world app.
Once you have managed to build and run this example, please go through the accompanying notes which dissect the various pieces of this guestbook example and explain their function.