Basically JSONP uses the HTML script tag to load data from a different 
domain (to avoid the same origin policy. It does not apply for script 
tags). 

That means that if you do a request to 
"http://localhost:8081/LMS-WB/services/authenticate/saranraju/welcome1/"; 
via JsonpRequestBuilder GWT will insert something like:

<script type="text/javascript" src="http://localhost:8081/LMS-WB/
services/authenticate/saranraju/welcome1/?callback=<javascript methodname>">

into the web page.

Note the "?callback=<javascript methodname>" portion of the URL. Your 
webservice has to evaluate the "callback" parameter and has to use the 
supplied method name for building the response. Instead of returning pure 
JSON you have to return Javascript (as the request is done via a script tag) 
and the correct return value would be "methodname({ ... JSON DATA ... })". 
Before doing the request GWT will add a JavaScript function to your web page 
and the name of that function will be send to your server via the callback 
parameter. That function will be called when your request is done and that 
function will call your onSuccess method.

As you have called jsonRequestBuilder.setCallbackParam("JSONCALLBACKPARAM"); 
you would have to evaluate the parameter "JSONCALLBACKPARAM" on your server 
and use its value to construct the return value as described above.

Hope that helps.

-- J.

-- 
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/-/nd1i1xMwEx4J.
To post to this group, send email to google-web-toolkit@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.

Reply via email to