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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T12:19:32+00:00 2026-06-17T12:19:32+00:00

I have clients that issue AJAX calls. These calls reference URLs that are protected

  • 0

I have clients that issue AJAX calls. These calls reference URLs that are protected by Spring Security on the sever side. If the user’s session has timed out, I have a login form popup in a lightbox. After the user has successfully logged in, I would like the client to re-execute AJAX call.

Here’s an example of the client side code that makes an AJAX call:

function handleSearchClick(evt) {
    var setupOptions = { 
        success: loadSearch,
        type: "POST",
        dataType: "json",            
        url:   "../search.ajax",
        error: handleError, // how can I pass callback info i.e. I want to be able to execute $("#searchForm").ajaxSubmit(setupOptions); from handleError? 
        timeout: 50000
    };                
    $("#searchForm").ajaxSubmit(setupOptions);
}

When the authentication fails, the server returns a 401 which results in the client calling handleError. Is it possible to pass a callback function to handleError? I would want the callback to re-execute

$("#searchForm").ajaxSubmit(setupOptions);

I have seen solutions to this problem where the server returns a success response on AJAX calls that have a session timed out. Then, the success function looks for something in the response to know the session timeout. The client then stores a callback function there. I prefer though to handle this in the error function.

  • 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-17T12:19:33+00:00Added an answer on June 17, 2026 at 12:19 pm

    The request executed by

    $("#searchForm").ajaxSubmit(setupOptions);
    

    can be re-executed in the handleError function by calling

    $.ajax(this);
    

    There is no need to pass in a callback function to re-execute:

    $("#searchForm").ajaxSubmit(setupOptions);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using ASP.Net Ajax's Page Methods and I have an issue that an
I have clients that use our web site (asp.net) that they have to be
I work at a company that has many clients that have their own website
I have some Lotus Notes clients that looses server connection. They suddenly get server
I have a HashMap with the addresses and the names of the clients that
I have coded a server in Java that will have several clients connected to
I have a table that stores various clients I have done work for, separated
I have two perforce clients (client-a, client-b) that each contain about 40 file specs.
I have heard that web-based chat clients tend to use networking frameworks such as
I have a server that connects to multiple clients using TCP/IP connections, using C

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.