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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:33:05+00:00 2026-06-02T16:33:05+00:00

I need my application to submit data to a web service and wait for

  • 0

I need my application to submit data to a web service and wait for 90 sec for the response. But if there’s a no response in 60 secs I need to redirect the user to a different page and continue to wait for the the response for another 30 secs if it come then process it.
I know I need to use thread for this but not sure how to integrate the treads in this case so threads can exchange data between themselves.

Any ideas?? I’m using JSF for UI.

The requirment is follows : The web service will send response in 90 secs (That’s the maximum response time for it). But the user will be given a response(A dummy response in case the response does not come within 60 sec) in 60 sec. So even if the user has been given a dummy response (after 60 sec) my application will continue to wait for another 30 sec for the response

  • 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-06-02T16:33:07+00:00Added an answer on June 2, 2026 at 4:33 pm

    Don’t know much about JSF, but it sounds like you want a timer, probably java.util.Timer. If the answer comes back before the timer goes off, shut down the timer. If the timer goes off, reset it for 30 seconds and redirect the user. The next time it goes off, give up waiting for the correct answer.

    That much you seem to understand. But you’ve got at least two interacting threads threads here. How to communicate?

    Just use instance fields. All references to them should be done with code in synchronized methods or blocks. Do that and you should be fine. You’ll have to figure it out, but I would imagine you’d have an int timerPhase, that would indicate the timer was not started, in the first 60 seconds, in the next 30, or timed out. Also a boolean answerReceived, something with the answer in it, and perhaps a few others.

    (Too much synchronization can slow your program down. I don’t think you will have this problem. But if you do, split the synchronize blocks up, with each field synchronized separately unless they interact. Remove synchronization and use the volatile keyword. Read up on multithreading. (Read up on the volatile keyword.) Think real hard about how parallel threads can interact. And prepare for things to get real weird.)

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

Sidebar

Related Questions

I need to submit data from a web application to console application. The current
I have a need to submit some data to a different host name and
I'm working on a Seam application and need to submit some form data to
I am working on a Web application and need to pass data across HTTP
In the java web application need to select the file from server and print
In my web application, I create some framework that use to bind model data
I am building a web application and I need to create a feedback form
I need to submit an XML and an image together to a restful web
I have to devellop an internal web based application with codeigniter and I need
I need to track/modify QtWebkit HTTP requests. I have a hybrid web/desktop application prototype

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.