Servlets and XML: Made for Each Other
By Doug Tidwell2005-05-18
A very basic servlet
For our first example, the middle step of creating the XML document is not our concern; we simply want to generate a valid XML document. We've hardcoded the document into our source code, shown in Listing 1.
Listing 1. xmlfromscratch.java
|
The result generated by this exciting piece of code looks like this:
Listing 2. Results from xmlfromscratch.java |
You can see an HTML view of the complete listing or view the Java source file directly.
Tutorial Pages:
» Our first sample servlet
» A very basic servlet
» Generating XML fragments
» Interfacing with a database
» Summary
» Resources
First published by IBM DeveloperWorks
