On 06/10/2010 08:55 AM, Andy wrote:
> public void doGet(String myurl) {
>
> myurl = URL.encode(myurl);
>
> RequestBuilder builder = new
> RequestBuilder(RequestBuilder.GET, myurl );
>
> try {
> Request request = builder.sendRequest(null, new
> RequestCallback() {
> public void onError(Request request, Throwable exception)
> {
> Window.alert("ERROR. Could not connect to server.");
> }
>
> public void onResponseReceived(Request request, Response
> response) {
> if (200 == response.getStatusCode()) {
> String ServerResponse = response.getText();
>
> } else {
> Window.alert("ERROR. Errorcode: " +
> response.getStatusCode());
> }
> }
> });
>
> How can i make this function return SereverResponce variable?
You can't. It's a void function. Stash the response in a private
variable and define a getter for that variable.
--
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.