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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:26:38+00:00 2026-06-04T02:26:38+00:00

I am a little confused here, building a web application which has tab sheet.

  • 0

I am a little confused here, building a web application which has tab sheet. In in the tab sheet class I am using a data member – static String variable to store the tab selected by the user. I am doing this so that I can display the tab last selected by the user when ther user returns to the tab sheet. I am getting the desirable results. However, if I logout and login (after deleting the cache on browser), the tab sheet is still picking the tab which user had last selected and not picking the default tab. The tab sheet is being initialised by another component. What I dont understand is, does the class defination not garbage collected? why is it picking the old data? how to fix this?

  • 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-04T02:26:39+00:00Added an answer on June 4, 2026 at 2:26 am

    You seem to be assuming that making a variable static somehow corresponds to isolating it to a user session. It doesn’t.

    If you want any sort of session handling, you’ll have to actually have a session. (You’ll need to consider what happens across server restarts, multiple servers etc.)

    When you have a static variable, that’s one variable for that class in that classloader. It doesn’t have anything to do with the user. All users will see the same variable, if they hit the same server.

    You haven’t told us anything about what technologies you’re using to build your web app, but basically you should look into what’s provided for you in terms of server-side user sessions – or propagate the information using hidden fields or something similar, so the server doesn’t need to keep track of it at all.

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

Sidebar

Related Questions

Ok, I'm a little bit confused here. I'm trying to select a DAO class
I'm a little confused by the class code. Here's what I'm trying to do:
Just a little confused here... I have a function in postgres, and when I'm
I've read similar questions here but I'm still a little confused. MyCollection extends ArrayList<MyClass>
I'm a little confused as to which one I should use. I think either
I'm a little confused here. if I pass a variable to json_decode, it doesn't
I'm a little confused here, I am trying use a partial view in a
I am a little confused here. What should I use Console.WriteLine((val/1085).ToString(N)); VS Console.WriteLine(String.Format({0:N}, (val/1085)));
I'm a little confused in here and need some help... the situation is I've
I am little confused on designing WCf services with EF. When using WCf and

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.