Helping ordinary people create extraordinary websites!
HOME TUTORIALS SCRIPTS WEB HOSTING BLOG FORUM
Get Our Newsletter
Your Email:

Servlets and XML: Made for Each Other

By Doug Tidwell
2005-05-18


Our first sample servlet

To get things started, we'll write a 10-line servlet that generates an XML document. As we build our XML-aware servlets, we'll follow three steps:
  1. Set the content type to text/xml.
  2. Create the XML document.
  3. Write the XML document back to the client.

In most of our servlets, most of our effort will be in the second step. We might create an XML document from a database query, we might generate it based on an HTTP parameter passed to us from the client, or we might use some other kind of data retrieval or generation method. In our examples here, we'll focus on HTTP parameters and database queries.



Tutorial Pages:
» Our first sample servlet
» A very basic servlet
» Generating XML fragments
» Interfacing with a database
» Summary
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» Starting with XML
» Performing Client-Side XSL Transformations
» Create a Google Sitemap for your Web Site
» XML and Scripting Languages
» Parsing Comma-Separated Values
» XML Security Suite: Increasing the Security of E-Business