I am using HTTPRequest.asyncPost() method with a URL like
http://someipaddress/process.php.
OnClick of a button, the program just tries to send a HTTPasync request
by posting the above URL..
Surprisingly, the post doen't go through at all. I mean, when I debug
this program using ECLIPSE, I could see that the
HTTPRequest.asyncPost() is doing nothing and it jjust comes out...
I tried to observe the packets sent using ethereal and there are no
packets sent out....
Please give some clues as to what the problem could be??Does this
HTTpRequest works at all??
One more interesting thing is that the generated JAVASCRIPT file
(generated by compiling the above JAVA code), does not contain even a
mention of the URL (http://someipaddress/process.php)??
I mean the javascript file should have this right in order to send the
request on click of the button??
Please help...
private static final String BASE_HOST = "http://localhost/project";
private static final String BASE_HOST_SCRIPT = "/project";
public static String url(String relative)
{
if (GWT.isScript())
return BASE_HOST_SCRIPT + relative;
else
return BASE_HOST + relative;
}
and I use it:
HttpRequest.asynPost(Server.url("my_file.php"), "some post data here",
myhandler)
Hope that helps
> ------=_Part_15683_33100614.1156561385498
> Content-Type: text/html; charset=ISO-8859-1
> X-Google-AttachSize: 1638
>
> You can't access another domain via HTTPRequest (as I understand it) IE will moan at you and FF completely ignores you. <br><br>
> <div><span class="gmail_quote">On 26/08/06, <b class="gmail_sendername">Shanky</b> <<a href="mailto:sankarsha...@gmail.com">sankarsha...@gmail.com</a>> wrote:</span>
> <blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>Using GWT, I have created a sample application, that interfaces with a<br>PHP script residing behind APACHE webserver.
> <br><br>I am using HTTPRequest.asyncPost() method with a URL like<br><a href="http://someipaddress/process.php">http://someipaddress/process.php</a>.<br><br>OnClick of a button, the program just tries to send a HTTPasync request
> <br>by posting the above URL..<br><br>Surprisingly, the post doen't go through at all. I mean, when I debug<br>this program using ECLIPSE, I could see that the<br>HTTPRequest.asyncPost() is doing nothing and it jjust comes out...
> <br>I tried to observe the packets sent using ethereal and there are no<br>packets sent out....<br><br>Please give some clues as to what the problem could be??Does this<br>HTTpRequest works at all??<br><br>One more interesting thing is that the generated JAVASCRIPT file
> <br>(generated by compiling the above JAVA code), does not contain even a<br>mention of the URL (<a href="http://someipaddress/process.php)">http://someipaddress/process.php)</a>??<br>I mean the javascript file should have this right in order to send the
> <br>request on click of the button??<br><br>Please help...<br><br><br><br><br></blockquote></div><br>
>
> ------=_Part_15683_33100614.1156561385498--
Thanks a lot for the tips..
I was accessing a URL in a different domain..that's why
XMLHTTPRequest.open() was throwing "permission denied" exception as u
mentioned...
Thanks a lot..