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

The Archive Base Latest Questions

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

I am building a struts 2 application with JPA. A user can login into

  • 0

I am building a struts 2 application with JPA. A user can login into the application multiple times. I want

  1. user to be able to view all his session in a grid and probably highlight the current session and optionally the user can select a session and terminate it.
  2. An administrator should also be able to see all the logged in users and can also view all the sessions of each logged in user and also can optionally terminate any of the sessions.

Thanks

  • 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-01T19:05:43+00:00Added an answer on June 1, 2026 at 7:05 pm

    I think HttpSessionBindingListener is what are you looking for.
    I won’t write down the complete code, just suggest you a way you can do it:

    You can add a static field (Map) to your User class (DTO) where you will store all active sessions of users. :

    e.g private static Map<User, HttpSession> usersSessions= new HashMap<User, HttpSession>();

    Then make User class implemets HttpSessionBindingListener. This way you can specify valueBound(HttpSessionBindingEvent event) method in which you can grab actually created session and put it into your usersSessions like this :

    usersSessions.put(this, event.getSession());

    In valueUnbound(HttpSessionBindingEvent event) method then :

    usersSessions.remove(this); to remove users session after logout.

    This way you have Map of all of your active sessions also with information to which user it belongs to. IMO you can figure out your other problems easily with this.

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

Sidebar

Related Questions

A friend of mine is now building a web application with J2EE and Struts,
I'm building a simple web application that handles a simple database using struts and
I'm building a JS client and want to be able to quickly test stuff
I have a simple form that I don't want accidentally submitted multiple times. I
Building a quick view that will display a list of all days but only
I'm creating a custom Java Struts tag that is for building and formatting an
Building a client-side swing application what should be notified on a bus (application-wide message
I have a client who is building a business application that will be used
I'm building a dynamic web application in Eclipse using Struts2 and OC4J 10.1.3.3.0. I'm
building on my last question jQuery getting values from multiple selects together I have

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.