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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:52:48+00:00 2026-05-28T01:52:48+00:00

In my web application , am annotation based controllers (SPRING MVC). I wanted to

  • 0

In my web application , am annotation based controllers (SPRING MVC). I wanted to implement SessionManagement in my application

1.) Any page within the application should not be idle for 15 minutes

2.) Pop-up should be opened, kind-of notification, at the 10th minute to notify the user abt session expiry and should give him an option to extend the session to another 15 minutes or by default the application should log-off

I believe there must be a simple way for this in spring MVC (I use spring 3.1). Say like, there must be some way to annotate the controller or some configuration in applicationContext.xml. There must be some way ! Friends, please help me by suggesting a way and also would be of great help if you paste any samples here. Also would be of great help if you can guide me step-by-step for this sessionManagement implementation.

  • 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-28T01:52:49+00:00Added an answer on May 28, 2026 at 1:52 am

    Spring MVC has little to do here. Suppose you have a session timeout set to 15 minutes. Simply place the following JavaScript code on every page on your site and run it after the page is loaded:

    function expireWarning() {
        if(confirm("Your session will expire in 5 minutes, extend?")) {
            $.ajax('/echo/json/');
            setTimeout(expireWarning, 10 * 60 * 1000);
        }
    }
    
    setTimeout(expireWarning, 10 * 60 * 1000);
    

    That’s it! After 10 minutes pop-up will appear. If the user confirms, AJAX request will be send to the server, automatically extending the session. The counter is then rescheduled to ask the user after another 10 minutes.

    Note that the AJAX target on the server doesn’t have to do anything. The only purpose of this call is to tell the container that the user is still using this session token.

    Another tip: if your site is already using AJAX, you must reschedule the timeout after every call because every AJAX call extends the session as well. If the user stays on the site and triggers a lot of AJAX calls, the session is extended over and over automatically.

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

Sidebar

Related Questions

We are working on a Spring 3.0.5 Web MVC-based application. In our code we
I'm writing web application that uses Spring MVC to bind Spring beans with REST-like
I'm developing bunch of relatively small Spring based java web-application. I'm mostly using annotations
We've got a Spring based web application that makes use of Hibernate to load/store
I currently work on a web application based on Spring 3.1.0.M1, annotations based, and
I'm developing a web application based on Hibernate, Spring and Wicket. Until now I
i am trying to create and run a simple Spring 3.1 mvc web application
My web application has a login page that submits authentication credentials via an AJAX
My web application crashes almost once a week due to not enought memory error.
I am playing with spring MVC 3.1 and testing different features. I wanted to

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.