krishna anusha wrote:I wrote a AJAX code such that it contacts the server and retrieves a xml file named books, suppose in future if few more books are added, then ultimately the xml file must be changed by the programmer, suppose if daily few books are added then what about the xml file.
No, of course the programmer isn't sitting next to the server and typing the XML. There would be some code on the server which generates the XML based on some data it gets from somewhere.
So what I want to do is, I will call a jsp, which will connect to database, then retrieve the data in xml file, then I will send this xml file to client, the AJAX code will parse the xml file and represent the data.
Is this possible? calling a jsp then retrieving a xml file, and representing the data, is this possible? If possible please tell me where can I find the complete solution, why because I am unable to find this is any site.
Actually you left out some steps there. It's not likely your code will retrieve XML from the database. More likely it will retrieve ordinary data from the database and construct an XML document from that data. Then yes, you would return that XML document as the response and the AJAX code would deal with it.
The other step you left out is, you wouldn't do most of that in a JSP. You would do the data extraction in a
servlet and then forward to the JSP, which would generate XML from the data.
So yes, of course it's possible. But if you were hoping to find a complete solution on the internet, you aren't going to find that. You will certainly find tutorials on various topics, like database processing and XML and so on. But there aren't people out there writing tutorials on combinations of three or more topics, like you were hoping.