I have not much experience with node.js but I would recommend to use
Chrome's Developer Tool or FireBug to check the XHTML request and response.
On Sunday, June 3, 2012 5:25:38 PM UTC+2, Kuenga wrote:
>
> HI,
>
> I have created a web server using NodeJS. At the server side, i have
> string of numbers (2,3,4). I want to convert it to Array object at the
> GWT object. I was not able to do.
>
> So was trying to display simple text message at GWT using the following
> code:
>
> Window.alert("Connecting to server");
> String Strurl = "http://127.0.0.1:1337/";
> RequestBuilder builder = new RequestBuilder(RequestBuilder.
> GET,
> URL.encode(Strurl));
> try {
> Request request = builder.sendRequest(null, new
> RequestCallback() {
> public void onError(Request request, Throwable exception) {
> // Couldn't connect to server (could be timeout, SOP
> violation, etc.)
> }
> public void onResponseReceived(Request request,
> Response response) {
> if (200 == response.getStatusCode()) {
> // Process the response in
> response.getText()
> Window.alert(response.getText());
> }
> else {
> // Handle the error. Can get the status text
> from
> response.getStatusText()
> }
>
> }
> });
> Window.alert(request.toString());
> } catch (RequestException e) {
>
> }
>
>
> Got the 'Conecting to Server' alert message but do not get the alert
> message inside the RequestBuilder call back.
>
> Below the javascript code of Nodejs
>
> http.createServer(function (req, res) {
>
> res.writeHead(200, {'Content-Type': 'text/plain'});
> res.write("From node js");
> res.end();
> }).listen(1337, '127.0.0.1');
>
> How can i get the data at the GWT side from NodeJS server javascript code ?
>
>
> Thanks
>
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-web-toolkit/-/Nl8RcUuYHUoJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.