Servlets
On the server side, we're not ready to accept an XML-RPC or SOAP request yet because that would require parsing an input XML document. I'll take that up beginning in Chapter 5. On the other hand, we are completely ready to respond to a CGI request with an XML document. Because this is a book about Java, I'll use servlets to do this. The user will connect to a known URL. The query string component will include a field asking for a certain number of Fibonacci numbers. The servlet will calculate that number and return it as an XML document with an attached stylesheet.
The query string will include a single generations field whose value is the index of the last Fibonacci number you want. For example, for a servlet installed at http://www.elharo.com/fibonacci ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access