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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:25:05+00:00 2026-06-01T09:25:05+00:00

I am using the embedded version of jetty. I have noticed the following: in

  • 0

I am using the embedded version of jetty. I have noticed the following:

in the handler method, if I want to directly respond with an HTTP OK response, then sleep for x seconds, the handler is doing the opposite. Is this normal?

the handle function is the following:

public void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

response.setContentType("text/html;charset=utf-8");
            response.setStatus(HttpServletResponse.SC_OK);
            baseRequest.setHandled(true);
            response.getWriter().println("OK");

Thread.sleep(10000);

}

The bastard is sleeping 10 seconds then returning the response, why is this happening?

  • 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-01T09:25:06+00:00Added an answer on June 1, 2026 at 9:25 am

    You need to call

    response.flushBuffer();
    

    before you sleep the Thread.

    From the JavaDoc of this method:

    Forces any content in the buffer to be written to the client. A call
    to this method automatically commits the response, meaning the status
    code and headers will be written.

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

Sidebar

Related Questions

I am using the embedded version of RavenDb and have put the physical database
I am using the Ajax Minifier http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=766 and have embedded it in the csproj
I have an install of django on apache using embedded wsgi. I DON'T have
So, I am running a web server using embedded jetty and the maven app-assembler
I am using Qt (Embedded Linux) and I want to hide the shortcuts displayed
I want to start development using qt-embedded on my embedded device project. Can you
I've tried to run a Wicket app in an embedded Jetty, using this code:
I'm using Jetty 7.0 embedded mode and looking for a way to force Jetty
I'm using an old version of python on an embedded platform ( Python 1.5.2+
I have application launched using maven cargo plugin with jetty6x. I get HTTP/1.1 413

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.