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

  • Home
  • SEARCH
  • 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 7635311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:24:03+00:00 2026-05-31T07:24:03+00:00

Netbean 6.9.1 GlassFish 3.0.1 jQuery 1.6.2 I’m testing my web app for timeout situation.

  • 0
Netbean 6.9.1
GlassFish 3.0.1
jQuery 1.6.2

I’m testing my web app for timeout situation.

My understanding of “timeout” is when Ajax request is being sent and if it took specified amount of time (like 30 sec), then timeout callback function is triggered.

I read jQuery Timeout too:

timeoutNumber

Set a timeout (in milliseconds) for the request. This will override any global timeout set with $.ajaxSetup(). The timeout period starts at the point the $.ajax call is made; if several other requests are in progress and the browser has no connections available, it is possible for a request to time out before it can be sent. In jQuery 1.4.x and below, the XMLHttpRequest object will be in an invalid state if the request times out; accessing any object members may throw an exception. In Firefox 3.0+ only, script and JSONP requests cannot be cancelled by a timeout; the script will run even if it arrives after the timeout period.

But while I’m testing timeout, error function is called and txtStat is shown “error” when it should be “timeout”. Here is my test step:

Test step:

  1. Start Glassfish server
  2. Go to the test page (foo.jsp)
  3. Stop Glassfish server
  4. click on the button on foo.jsp to send ajax request.

Expected result:

Ajax request is sent but unable to reach to the server and error callback function is called and its argument: txtStat should have value “timeout”.

Actual result:

The error callback function is called and its argument: txtStat has value “error”

So is this expected behavior or is my understanding of timeout wrong?

My ajax code:

$.ajax({
        url: "../resources/plan/list/some",
        type: "get",
        dataType: "json",
        timeout: 30000,
        success: function(data, txtStat, xhr) {
            console.log("success")
        },
        error: function(xhr, txtStat, errThrown) {
            if(txtStat === "timeout") {
                console.log("timeout");
            }
            else { //txtStat === "error", "abort", "parseerror"
                console.log(txtStat);
            }
        },
        complete: function(xhr, txtStat) {
            console.log("completed");
        }
    });
  • 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-31T07:24:04+00:00Added an answer on May 31, 2026 at 7:24 am

    Indeed, your understanding of a request timeout is not quite right. A timeout occurs when the request takes more than a certain amount of time, but when the server is down, you’ll find that the response returns immediately. Try navigating to a page of your web app while it is not running, just in a browser. For example:

    enter image description here

    It finishes immediately, because the browser can’t even connect.

    To cause a timeout condition, keep your server running, but request a page which does something like Thread.sleep(60000) – the server will accept the request, but not send a response before the configured ajax time runs out.

    That is a timeout: when a request is accepted, but a response is not sent in time.

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

Sidebar

Related Questions

I'm building REST web app using Netbean 7.1.1 Glassfish 3.1.2 I have 2 URL:
I'm studying RESTful web service using Java. My environment is using Netbean with GlassFish
I want to make Restful - Web Service using netbean 6.5, glassfish V 2
My environment: Netbean 6.9.1 Glassfish 3.0.1 Windows 7 Goal: When my coworkers opens the
I'm just getting to grips with JPA in a simple Java web app running
i'm trying to run my java EE web application on Glassfish v3.x on Netbeans
Start a new web application using NetBeans 7 on GlassFish 3.1 In index.xhtml body
I am using Netbeans 6.9 and Glassfish 3.1 to create my web application. Now,
Environment: Windows 7, NetBean 6.9 (the one including GlassFish v3, Java EE 6), MySQL
I'm doing my first Java EE web application using glassfish and netbeans. When I

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.