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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:00:09+00:00 2026-05-20T16:00:09+00:00

I have a web application that our product owner has stated must respond within

  • 0

I have a web application that our product owner has stated must respond within 2.5 seconds and be usable within 3 seconds.

Right now it’s mostly POJOs on top of a thinly sliced Spring MVC layer which is being used for dependency injection and directing requests to controllers.

The webapp is a very thin slice of meat between a stack of APIs which are being built to provide cohesion to a disparate set of very old, irregular APIs. Some of which can take longer than 3 seconds (though not too often)

What I want is a way to tell spring or tomcat that if it isn’t loading the JSP by within 2500ms I want to load the jsp that tells our user that “Dude, we’re crawlin’ through molasses here! Give us a second and try again. If you get this page multiple times; then you’re really boned!”

Right now it appears I could do this several ways (ordered by my desire)

  • In spring I may be able to set up a timeout and load a different jsp
  • In the load balancer I may be able to set up a timeout with a redirect
  • In tomcat I may be able to set up a timeout and load a different jsp
  • In apache I may be able to set up a tomcat iwth a redirect
  • in the app I split the architecture to run inside a thread that is polled every 100ms to see if it had stopped running, and after 2500ms it throws an exception
  • 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-20T16:00:09+00:00Added an answer on May 20, 2026 at 4:00 pm

    If I remember correctly, all requests to Spring MVC go via a single filter. You can probably override it and program your timeout settings (e.g. have a configurable XML with timeout-enforced URLs or paths). Guava’s TimeLimiter would be a good tool to implement the timeout enforcement itself.

    <general-rant>

    I don’t know the industry you’re in, but generally in the web world it is a bit too self-demanding to panic if a response doesn’t come back in 2-3s, especially if long taking responses are just a minority (as you say). I have experience with large heaps (Xmx=10g) where just a GC can take several minutes to accomplish. OK, maybe this is an overrated example, but one-two second taking GCs are pretty reasonable.

    Even Tomcat manual says that very small timeouts will likely be counterproductive. Your product owner must be choleric 🙂

    </general-rant>

    Ah, there’s more. Don’t forget you can’t just redirect if you have already posted something back to your servlet response. So you probably need to delay your response until the last bit of computation is done and flush everything at the end. This means you have to wrap your HttpServletResponse with a decorator which has some sort of a latch which delays response output until the full response is generated, or if timeout occurs – redirects to “ouch” page.

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

Sidebar

Related Questions

We have a web application that manages inventory for our computer support group. One
I have this web application that has grown to an unmanageable mess. I want
Suppose you're the product manager for an internal enterprise web application that has 2000
I have a web application that should behave differently for internal users than external
I have a web application that is becoming rather large. I want to separate
I have a web application that needs to take a file upload from the
I have a web application that's branded according to the user that's currently logged
I have a web application that allows a user to search on some criteria,
I have a web application that makes heavy use of the Session state to
I have a web application that comprises the following: A web project (with a

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.