kurinosuke (156) [Avatar] Offline
Listing 5.15, CommandServlet.java.
The servlet is reading the incoming xml data, looking for the root tag "commands".

I can't figure out where the "commands" tag is being set.
In listing 5.13, CommandQueue object, we set a request parameter called "data" to, appending each command in the queue. So all "command" tags will be concatenated to the "data" request parameter. I can't see where the root tag is being set.

Anything I'm missing, or is it an inconsistency in the sample code ?

Moreover, we are using a ContentLoader in Listing 5.13 with POST method, not specifying the contentType. So it will default to x-www-form-urlencoded. How can we make a Document in Listing 5.15 although the request is not in xml format ? The doPost method seems out of context in this chapter.