Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7444217
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:27:59+00:00 2026-05-29T11:27:59+00:00

I want to use RequestBuilder to make HTTP requests in my PlayN project as

  • 0

I want to use RequestBuilder to make HTTP requests in my PlayN project as described here:
http://code.google.com/webtoolkit/doc/latest/DevGuideServerCommunication.html#DevGuideHttpRequests

I added the tag in my module xml file:

but I still have the following compilation error:

The import com.google cannot be resolved

Is there something else I should do to make my project compile?

Here is the code:

import com.google.gwt.http.client.*;
...

String url = "http://www.myserver.com/getData?type=3";
RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, URL.encode(url));

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()
  } else {
    // Handle the error.  Can get the status text from response.getStatusText()
      }
    }
  });
} catch (RequestException e) {
  // Couldn't connect to server
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T11:28:01+00:00Added an answer on May 29, 2026 at 11:28 am

    If you’re using Maven for your build (which I suspect you may be), make absolutely sure that the following dependency is in your html/pom.xml

    <dependency>
      <groupId>com.google.gwt</groupId>
      <artifactId>gwt-user</artifactId>
      <version>2.4.0</version>
      <scope>provided</scope>
    </dependency>
    

    You might need to change the version if you’re using a version of GWT other than 2.4.0

    Edit: Now that I know you are running a Java application (based on the comments below) and not a GWT application, you’re likely going to need to make HTTP requests with something other than GWT’s HTTP client. You’ll want to remove the aforementioned dependency and take a look at the answers to this question for some insight into how to do that…

    If you’re needing to make HTTP requests in both the GWT and Java PlayN targets, you’re likely going to need to abstract the HTTP client interface needed in the core module and provide the appropriate concrete implementations in the java and GWT modules. I describe using Gin and Guice to inject java and GWT specific instances of AsyncService<> objects in this answer here, and a similar approach can be used in injecting the appropriate HTTP client instance required on a per platform basis if necessary…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i use this http://www.mudaimemo.com/p/quickedit/# and it work good the problem is i want use
I use codeigniter and i want make uniqid code with php as following code(by
i want to use title on text. is this possible to make title on
I want use regex to make a judge, if some sring's structure is made
I want use a Linq IQueryable Toolkit in project on .NET Compact Framework. The
I want use $.ajax to read some infomation from xml file,here is my js
i want use XmlSampleGenerator API in my project. i don't know how to add
My question here is why should i want use the entity framework instead of
I'm want use $ macro in groovy GString. When i'm wrote this code ['cdata','tdata'].each
I want use from multiple upload image in codeigniter but problem is here that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.