Thu Aug 23, 2012 1:04 am
if(request)
{
//The autocalled funtion when the status changed
request.onreadystatechange = function() {
//Status cases of the readState varrible
if(request.readyState==0)
document.getElementById('status').innerHTML='Uninitialized';
else if(request.readyState==1)
document.getElementById('status').innerHTML='Loading...';
else if(request.readyState==2)
document.getElementById('status').innerHTML='Loaded';
else if(request.readyState==3)
document.getElementById('status').innerHTML='Interactive';
else if(request.readyState==4)
{
document.getElementById('status').innerHTML='Completed';
var xml_response = request.responseXML;
xml_response.loadXML(request.responseText);
var myname=xml_response.getElementsByTagName('name');
document.getElementById('Txtdata').value=myname[0].childNodes[0].nodeValue;
}
dojo.xhrPost( {
url: 'service URL',
content: {},
handleAs: 'text',
load: function(response, ioArgs) {
// Do something
},
error: function(response, ioArgs) {
alert("Failed while doing the operation: " + ioArgs.xhr.response);
}
});
public class siteServelt extends HttpServlet {
protected void doPost(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
try {
// Your code site here.
} catch (Exception exception) {
response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
response.getWriter().write(exception.getMessage());
response.flushBuffer();
} finally {
}
}
}
Codemiles.com is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com
Powered by phpBB © phpBB Group.