I am able to call the servlet with the given URL, I have used SOPs on the servlet to see that it is being called. I think the problem is with the response. When I call the 'callback()' function, the status of the req.readystate is never equal to 4.
The alert message informs me that the value is "one". That is reason why I do not proceed any further and cannot call the parseMessage() and setMessage() functions, which receive the request from the servlet and update the HTML.