473,785 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XMLHTTP Question

Hi,

I've been looking into the possibility of using XMLHTTP for my
enterprise application but I still have a question.

When you send the request to the server, how does the server know how
to handle the request? (i.e. how do I specify what method to call in my
java servlet?)

I'd appreciate any help on this.....I've only got a vaey basic
knowledge of javascript and I am fluent in java.

Thanks,

B

Jul 23 '05 #1
5 1578

Treat it as you would any other URL.

MK
<bb******@gmail .com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
Hi,

I've been looking into the possibility of using XMLHTTP for my
enterprise application but I still have a question.

When you send the request to the server, how does the server know how
to handle the request? (i.e. how do I specify what method to call in my
java servlet?)

I'd appreciate any help on this.....I've only got a vaey basic
knowledge of javascript and I am fluent in java.

Thanks,

B

Jul 23 '05 #2


bb******@gmail. com wrote:

I've been looking into the possibility of using XMLHTTP for my
enterprise application but I still have a question.

When you send the request to the server, how does the server know how
to handle the request? (i.e. how do I specify what method to call in my
java servlet?)


The request is simply a HTTP request, for instance a GET request, a
servlet then knows how to treat a HTTP GET request and the servlet
container I think provides an API to read the query string. Similar if a
HTTP POST request is send I think a servlet has a method to process such
requests and read out the body of the POST request.
So on the client you need to decide about the URL of the servlet, about
the HTTP request method (e.g. GET, POST etc) and then make the request e.g.
var httpRequest = new XMLHttpRequest( );
httpRequest.ope n('GET', 'servletURL', true);
// now set request header if needed
httpRequest.onr eadystatechange = function () {
// handle response here e.g.
if (httpRequest.re adyState == 4) {
..
}
};
httpRequest.sen d(null);
or
var httpRequest = new XMLHttpRequest( );
httpRequest.ope n('POST', 'servletURL', true);
// now set request header if needed
httpRequest.set RequestHeader(' Content-Type',
'application/x-www-form-urlencoded');
httpRequest.onr eadystatechange = function () {
// handle response here e.g.
if (httpRequest.re adyState == 4) {
..
}
};
httpRequest.sen d('a=1&b=2');

A HTTP request doesn't call particular methods on the server, for that
you would need to look into webservices, IE/Win with the webservice
behavior and Mozilla with its webservice proxying API allow that but of
course then you also need to implement a web service on the server.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3
<SNIP>
A HTTP request doesn't call particular methods on the server, for that
you would need to look into webservices, IE/Win with the webservice
behavior and Mozilla with its webservice proxying API allow that but of
course then you also need to implement a web service on the server.


On the other hand, XMLHTTP CAN call specific "functions" , or verbs on
the server. Take, for instance the WebDAV implementation of Hotmail, in
the WebDAV specs, there are no mentions of BPROPPATCH, BDELETE, BMOVE,
verbs, etc. However, you can call them using XMLHTTP on their WebDAV
implementation.

It really depends on how your server is written.
Jul 23 '05 #4


Mr.Clean wrote:

A HTTP request doesn't call particular methods on the server, for that
you would need to look into webservices, IE/Win with the webservice
behavior and Mozilla with its webservice proxying API allow that but of
course then you also need to implement a web service on the server.


On the other hand, XMLHTTP CAN call specific "functions" , or verbs on
the server. Take, for instance the WebDAV implementation of Hotmail, in
the WebDAV specs, there are no mentions of BPROPPATCH, BDELETE, BMOVE,
verbs, etc. However, you can call them using XMLHTTP on their WebDAV
implementation.


Other protocols can certainly be implemented on top of HTTP or using
HTTP as the transport, for instance a web service client and a web
service server usually communicate by exchanging SOAP messages over HTTP
and for instance the MS web service behavior is implemented with the
help of Microsoft.XMLHT TP.

But the original poster asked about XMLHTTP and servlet communication,
that looks more like doing a certain HTTP request (e.g. GET, POST) on
the client and processing that with the servlet as something that
receives HTTP requests and sends a HTTP response.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #5
In article <42************ ***********@new sread2.arcor-online.net>,
ma*******@yahoo .de says...


Mr.Clean wrote:

A HTTP request doesn't call particular methods on the server, for that
you would need to look into webservices, IE/Win with the webservice
behavior and Mozilla with its webservice proxying API allow that but of
course then you also need to implement a web service on the server.


On the other hand, XMLHTTP CAN call specific "functions" , or verbs on
the server. Take, for instance the WebDAV implementation of Hotmail, in
the WebDAV specs, there are no mentions of BPROPPATCH, BDELETE, BMOVE,
verbs, etc. However, you can call them using XMLHTTP on their WebDAV
implementation.


Other protocols can certainly be implemented on top of HTTP or using
HTTP as the transport, for instance a web service client and a web
service server usually communicate by exchanging SOAP messages over HTTP
and for instance the MS web service behavior is implemented with the
help of Microsoft.XMLHT TP.

But the original poster asked about XMLHTTP and servlet communication,
that looks more like doing a certain HTTP request (e.g. GET, POST) on
the client and processing that with the servlet as something that
receives HTTP requests and sends a HTTP response.

XMLRPC can be achieved using XMLHTTP and just POST and GET. That is how
SOAP is implemented, correct?

Jul 23 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1755
by: WhenAmIOn.com | last post by:
Hi all, I developed a web site that uses javascript and XMLHTTP to dynamically load info on the page from the server without having to re-load the page. Recently I've received complaints of it not working, and the common thread is that these users have Norton Internet Security installed (sorry, don't know the version, but let's assume the latest). I don't have NIS. Can anyone give me clear instructions as to how a user can change his/her...
4
3053
by: parksch2 | last post by:
When I execute the following example code from my local test environment: var xmlhttp.open("HEAD", "http://www.google.com",true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4) { alert(xmlhttp.getAllResponseHeaders()) }
6
10459
by: Vanessa | last post by:
I have a question regarding async mode for calling Microsoft.XMLHTTP object. Microsoft.XMLHTTP hangs the IE once in a while suddenly, but it will work again after half an hour or so without doing anything. I have searched through the Internet and seems like the reason it hangs the browser it's because XMLHTTP limits you to two concurrent HTTP connections to each remote host; so if more than 2 concurrent connections strike the script...
1
1332
by: Dave H | last post by:
First.. What object (on the client) should I be using these days? var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); or var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); or maybe something different?
3
9565
by: Noozer | last post by:
Hrm.. last posting was mangled. Let's try again, with more detail... I'm just starting to try out "Ajax" web programming and I've got a question. AJAX is fairly straightforward. Javascript creates an XMLHttp object and then uses that to generate a hidden webpage with your results. What I'd like to know is, how can I retrieve multiple values from an XMLHttp request?For example, if my request generated an SQL query that returned a...
1
3102
by: mirandacascade | last post by:
I recognize that this question is not about javascript per se...it is more about xmlhttp...posting the question at this site because it appears as though this site has many posts related to xmlhttp Situation is this: 1) making use of the COM object MSXML2.XMLHTTP in a client application 2) I use the open() method of the COM object and specify a "POST", then I use the send() method of the COM object 3) when the url is an http url, able...
14
14187
by: =?Utf-8?B?VmFuZXNzYQ==?= | last post by:
I've been searching everywhere online to find an alternative method besides using Microsoft.XMLHTTP (as it freezes the server up alot!!) but with no luck at all. I am using server side ASP, and some said to use Microsoft.ServerXMLHTTP instead. However I have tried that as well and it still freezes up the whole thing (i.e. the site just keeps loading forever). I tried to do a "on error resume next" clause to catch the error but still...
2
12471
by: trpost | last post by:
Is it possible to execute javascript as passed in xmlHttp.responseText Here is what I am doing: search.js var xmlHttp xmlHttp=GetXmlHttpObject() var url="search.php" xmlHttp.onreadystatechange=stateChanged
2
1911
mothermugger
by: mothermugger | last post by:
I saw some posts about this problem in the archives. But I can't gleam what the solution is... This works fine except • <== here is the problem the dot becomes 2 question marks (try the code) when displayed I try replace on the response text but I can't replace anything! I understand that this has to do with char encoding on high ascii chars etc. can anyone fix this to work? Any help would be great. I would be happy to just lose the...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10336
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8978
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7502
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
3
2881
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.