Issue a get command from browser for a particular XML file
To get this XML file:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<command action="retrieve" id="1234" code = "24" >
</command>
</root>
I would always issue this GET command from the browser(using Tomcat server):
http://localhost:8080/program?command=retrieve&id开发者_如何学Python=1234&code=24
But what if the XML changed, and now I have this one:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<command action="retrieve" id="1234" code = "24" >
<subelement id = "1">SomeStringhere</subelement>
<subelement id = "2">SomeOtherStringHere</subelement>
</command>
</root>
How can I write my GET command now to integrate the subelements of the file ?
Thanks.
The mapping of a URL onto a resource is dependent on the server.
How you get the server to respond to a request with the second set of example data depends on the servelet (or whatever) that you've written and mapped /program on to.
精彩评论