Hi Jaya, It's really hard to say. I guess I would try testing things in pieces, see if they work independently...
First, try making the request to your servlet without GWT. That is, use your browser (or some other tool) to make the request your server expects and then verify that your getting the response you expect. Once you've verified that the server part of things is okay, you can move on to looking at your GWT code. At this point I guess you could try some other JS library (jQuery for example) see if you get different behaviour as GWT. Hope it helps, Philippe On Aug 12, 1:00 pm, Jaya <[email protected]> wrote: > Thanks Phillippe, > > I now noticed after deploying the GWT web app on the same domain > likehttp://mydomain/u2/Gwt.html, it is not getting the response after > calling thehttp://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 <[email protected]> > 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 <[email protected]> > > 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 <[email protected]> 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 [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.
