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 6092991
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:30:31+00:00 2026-05-23T12:30:31+00:00

I make Web Application on Google App Engine and I use AsyncURLFetch Api. But,

  • 0

I make Web Application on Google App Engine and I use AsyncURLFetch Api.

But, I cannot get response. Please help me…

Searc.java

private ArrayList<Future<HTTPResponse>> fetchURL() {
    ArrayList<Future<HTTPResponse>> futureList = new ArrayList<Future<HTTPResponse>>();

    for (SearchResult searchResult : searchResultList) {
        if (!searchResult.isEmpty()) {
            for (WebPage webPage : searchResult.getWebPageArray()) {
                try {
                    URL url = new URL(
                            "http://myapi.appspot.com/htmlparser?url="
                                    + webPage.getPageURL());
                    URLFetchService us = URLFetchServiceFactory
                            .getURLFetchService();
                    futureList.add(us.fetchAsync(url));
                } catch (MalformedURLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
    }
    return futureList;
}

private ArrayList<HTTPResponse> getFetchResult(
        ArrayList<Future<HTTPResponse>> futureList) {
    ArrayList<HTTPResponse> responseList = new ArrayList<HTTPResponse>();
    try {
        for (Future<HTTPResponse> future : futureList) {
            if (future.isDone()) {
                log.info("future calls get");
                HTTPResponse resp = future.get();
                responseList.add(resp);
            }
        }
    } catch (InterruptedException e) {
        e.printStackTrace();
        log.info(e.getMessage());
    } catch (ExecutionException e) {
        e.printStackTrace();
        log.info(e.getMessage());
    }
    return responseList;
}

HTMLParser.java

public class HTMLParser extends HttpServlet{
protected static Logger log = LoggerFactory.getLogger(HTMLParser.class);

private PrintWriter writer;
private URL paramURL;

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException {
    // TODO Auto-generated method stub
    resp.setContentType("text/html; charset=utf8");
    writer = resp.getWriter();
    getParameter(req);
    viewTest();
}

private void getParameter(HttpServletRequest req){
    paramURL = getURL(req);
}

private URL getURL(HttpServletRequest req){
    try {
        URL url;
        url = new URL(req.getParameter("url"));
        return url;
    } catch (MalformedURLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    return null;
}


private void viewTest(){
    writer.println(paramURL);
    log.info(paramURL.toString());
}}

future.isDone() is “false”

What I do something to get “true” ?

  • 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-23T12:30:32+00:00Added an answer on May 23, 2026 at 12:30 pm

    Have you read the documentation on Java Futures? future.isDone() will not block, and will return False until the future has finished executing. To get the results of all the asynchronous calls, you should call future.get() on each one unconditionally.

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

Sidebar

Related Questions

I have a web application running on Google App Engine (GAE) for JAVA. I'm
we have create a web application on top of google app engine and python.
My desktop app connects to a web application that's hosted on Google App engine.
I'm moving a Google App Engine web application outside the cloud to a standard
I am developing an Twitter4J web application in Google App Engine/Java. I need to
I am trying to include the following Tag In Google App Engine Web Application:
Web-Applications these days make extensive use of Javascript, for example various Google Products like
I'm using the Google App Engine in combination with the Google Web Toolkit to
I'm writing a web application using the google maps api v3, which displays places
I am currently developing a web app that uses Google's Static Map API, in

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.