Flash Games

 FAQ   Search   Members   Groups   User Control Panel      Login 

It is currently Wed Jan 07, 2009 8:54 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: [resolved] AJAX call to a servlet
PostPosted: Sun Oct 28, 2007 1:17 am 
Offline

Joined: Sun Oct 28, 2007 1:14 am
Posts: 0
Hi all,

I try to asynchronously pass a request to a servlet using the XMLHttpRequestObject.

When I use method GET in open(), the request seems to be sent, but the servlet receives an empty(null) request and it returns a default response (not the required one).

When I use method POST, I also try to set the request header using:
XMLHttpRequestObject.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
However, in this case the XMLHttpRequestObject.status = 405. Hence, I'm afraid the request header is not set properly - maybe I set it the wrong way.

When I try to display the response headers using: document.write("Get All Response Headers: " + XMLHttpRequestObject.getAllResponseHeaders);
...the output is:
Get All Response Headers: function getAllResponseHeaders() { [native code] }

If I try to display the changes in the XMLHttpRequestObject status, I get the following output:

OPENED state (1)
HEADERS RECEIVED state (2)
LOADING state (3)
DONE state (4)
state: 1
HEADERS RECEIVED state (2)
LOADING state (3)
DONE state (4)
state: 2
LOADING state (3)
DONE state (4)
state: 3
LOADING state (3)
DONE state (4)
state: 3
LOADING state (3)
DONE state (4)
state: 3
LOADING state (3)
DONE state (4)
state: 3
LOADING state (3)
DONE state (4)
state: 3
LOADING state (3)
DONE state (4)
state: 3
DONE state (4)
state: 4


I read the XMLHttpRequestObject documentation: http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest, but I still cannot figure out what the problem is.


I'll be happy if you could give me any hint about what could be wrong or how I can continue debugging. I already ran out of ideas.

Thanks,
Pesho


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group - Flash Games - TNX Invitation Code - TNX Review

Welcome to DEVPPL.com
You are not logged in, which means that you can't post in the forums.
Click here to Register

If you are a current member here on DEVPPL, please login below:

User:
Pass:
Log me on automatically each visit: