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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:53:10+00:00 2026-05-20T14:53:10+00:00

I have a servlet for the purposes of uploading my application’s database in android.

  • 0

I have a servlet for the purposes of uploading my application’s database in android.

The database is processed on the server side but that could take a while.

At the moment, I’m just returning back with a response that the upload has been successful using PrintWriter.write().

Is there a way after the response has been sent to the client(my android app) to start processing the file?

If I send a redirect to another servlet or forward the request using the dispatcher, I won’t have a response until the servlet that carries out the processing is finished.

What’s the best way, to respond to the user instantly,let the processing of the database begin and send the results back to android (note this could take 5 minutes or 10 minutes, depending on the database – so I’m assuming I would need some sort of listener to poll on the server whether the results have been processed and ready to be shown on the client)

  • 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-20T14:53:11+00:00Added an answer on May 20, 2026 at 2:53 pm

    The backend processing can be done via a job, e.g. via Quartz. If the server could be replaced with JBoss AS, Glassfish or Resin, a simple @Asynchronous annotated method could also do the job here.

    You can indeed poll the server continuously to ask if it’s already done. This is what the majority of the AJAX based progress bars in a web environment also do.

    Alternatively you could make use of reverse AJAX (Comet) to prevent the polling (see e.g. http://atmosphere.java.net/). In that case the server is able to push a response back to you as soon as it’s done. This does necessitate some kind of eventing on your server. If you could replace the server with JBoss AS or Glassfish, the CDI event bus could be an option. Otherwise, a shared object in the HTTP session on which you call wait/notify is a crude alternative.

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

Sidebar

Related Questions

I have servlet in my web.xml but i don't want my application to load
I have servlet in my web application that serves images, and when I visit
I have a servlet that does some business login and then redirects to a
I have a servlet running on GAE and I have a cron job that
We have a servlet which occupies more virtual memory on the server due to
We have a servlet which occupies more virtual memory on the server as it
I have a servlet. But it is not working as desired. Hence for debugging
I have a servlet that takes a couple of minutes to process and return
I have a Servlet called Menu that generates some html and a dynamic menu,
I have seen some applications that use a servlet to serve the images. What

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.