Thanks Phillippe, I now noticed after deploying the GWT web app on the same domain like http://mydomain/u2/Gwt.html, it is not getting the response after calling the http://mydomain.com/u1/MySerlet. The 'MyServlet' is getting request from Gwt.html and sending the response to GWT.html.Can you please suggest any thing i should look into.? I am trying all possible ways. Interestingly the request has been sent to servlet. I don't know whether the request can be sent in the first place if it is against the SOP.
On Aug 12, 8:50 am, Philippe Laflamme <philippe.lafla...@gmail.com> wrote: > Oops. It should have read: > > "[...] is considered a cross-site request (per the same-origin > policy). [...]" > > Philippe > > On Aug 11, 9:52 am, Philippe Laflamme <philippe.lafla...@gmail.com> > wrote: > > > > > Had the same issue. In my case, it was due to making cross-site > > requests. > > > My server was at localhost:8080 and I was running in DevMode at > > localhost:8888. Making a request from :8888 to :8080 is considered a > > cross-site request (which is not per the same-origin policy). > > > The behaviour in Firefox was that it would return 0 as the status code > > and prevent accessing the HTTP headers. > > > I solved this issue by running a transparent proxy on :8888 in > > DevMode. The proxy forwards everything to :8080. I provided the > > solution > > here:http://code.google.com/p/google-web-toolkit/issues/detail?id=3131#c46 > > > Hope it helps, > > Philippe > > > On Aug 10, 5:11 pm, Jaya <jp.a...@gmail.com> wrote: > > > > Hi All, > > > I have deployed the GWT web app ( only client code. no server code is > > > present) on JBOSS. web client is accessing a URL ( Servlet of > > > different application. not the GWT servlet) on the same server using > > > POST. The servlet is getting the Request (xml string) from GWT client > > > app and responding with a xml string ( appeared in the servlet logs). > > > But the GWT client's onResponseReceived () always return a status > > > code 0 with response data null. > > > > here the basic code i am using. no fancy of it. > > > > String eventParticipationReq="<Count id=\"1\"></Count>"; > > > String serverURL="http://myserver:8080/b1/MyServlet?"; > > > Log.info(serverURL); > > > Log.info(eventParticipationReq); > > > RequestBuilder builder = new > > > RequestBuilder(RequestBuilder.GET, > > > serverURL); > > > try { > > > > Log.info("Request Data > > > :"+eventParticipationReq); > > > Request response = builder.sendRequest("", 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) { > > > Log.info(""+response.getStatusCode()); > > > Log.info(""+request.isPending()); > > > if (200 == response.getStatusCode()) { > > > Log.info(response.getText()); > > > } else { > > > // Handle the error. Can get the status > > > text from > > > response.getStatusText() > > > } > > > } > > > }); > > > return null; > > > } catch (RequestException e) { > > > // Code omitted for clarity > > > e.printStackTrace(); > > > } > > > > ===================================================== > > > > Can some one please let me know what i should change in the code? -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to google-web-tool...@googlegroups.com. To unsubscribe from this group, send email to google-web-toolkit+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.