How can I clear session?

Hi everyone,
I have a little problem, I have a JSP tree. The tree displays structure
of files and subdirectories in specified directory.
When session is empty I call function loadData1() and make tree and put them
into session. But any change in the structure I cannot see, after page
refresh. The change is visible only when I close browser and load again.
here is some code:
// Get Tree from session
     if (jspSession.getValue(SESSION_TREE) != null)
// Get the tree from session
     jspTree = (Tree) jspSession.getValue(SESSION_TREE);
// Get Tree from database or data source
else {
jspTree = loadData1();
session.putValue(SESSION_TREE, (Tree) jspTree);
please help

Hi coolovac,
I know this is about one year after your original post, but in case someone searches for it, here is what you could have done:
Your code above only updates the contents of your tree if there is currently NO tree set on the session. This is because of the else clause of your if-statement:
if (jspSession.getValue(SESSION_TREE) != null){
jspTree = (Tree) jspSession.getValue(SESSION_TREE);
} else {
jspTree = loadData1();
session.putValue(SESSION_TREE, (Tree) jspTree);
Your else clause is what builds the tree instance from the database, and your else clause is only run IF you do not currently have a tree instance in the session (jspSession.getValue(SESSION_TREE) == null). What you need to do when you change something in the database is either:
a) Remove the tree instance from the session. That way your else clause will be run again.
b) If you are using the Jenkov JSP Tree Tag (which I suspect from the above code, it looks like code from the demo), you can add expand and collapse listeners to the Tree instance. These listeners can then load child nodes of a node when that node is expanded. That will give dynamic updates of the tree.
You can find the Jenkov JSP Tree Tag here, if you are not already using it:
http://www.jenkov.dk/projects/treetag/treetag.jsp

Similar Messages

  • How can i clear all events in ical

    how can i clear all events in ical

    Try typing "." without the exclamation points in the iCal search window. Then simply highlight all the entries > Edit/Delete

  • GR/IR Key manditory in PO...How can i clear customs duty befor GR

    Hi All,
    As per the business requirement, i made GR based IR manditory in PO. Now for Import Pos, how can i clear the customs duty before doing GR.]
    Regards,
    Naidu.

    Hi
    Custom duty is a delivery cost. You can process the delivery cost before GR even with activation of "GR Based IV".
    Control due to "GR Based IV" is applicable for goods item invoice.
    warm regards
    sairam akundi

  • How can i clear the usernames and passwords history from all login websites?

    how can i clear the usernames and passwords in the log in history of the websites? example when i want to login to my facebook i always type first letter of my e-mail and it comes with the passwords because before i put remember my password, and in other websites so, i just need to delete all this login history and it's not working from the clear everything !!! :S any idea please !! thanks in advance :)

    See:
    http://kb.mozillazine.org/Deleting_autocomplete_entries
    http://kb.mozillazine.org/Password_Manager

  • I have forgotten my password and locked my phone, how can i clear the problem

    I have forgotten my password and locked my phone, how can i clear the problem

    By coincidence, this happened to my son just last night.  You do NOT have to restore it to a new phone, but you probably want a current backup.
    Luckily, you can still sync and back it up even if it's locked, so connect it to the computer you usually sync it to. Go to the summary page. It's easiest and fastest to use a local backup, so if iCloud backup is on, turn it off and click "Backup now".  
    After it backs up, either click "Restore iPhone", or
    - hold home and the top button until the screen goes black, release the top and continue to hold the home button until iTunes says "iPhone in recovery mode detected". 
    Follow instructions to restore from backup, and then sync to restore content.  Your phone will come up in an unlocked state. If you have any stuff that was purchased directly to the iPhone (only), you'll have to re-download it. 
    Remember to turn iCloud backups back on if you use them.
    If you don't sync you iPhone to a computer then I *think* those instructions with the buttons will put it into a mode where you can restore it from the cloud (make sure it is NOT connected to a computer while you do this). Otherwise, you will have to restore it as a new phone, then go to settings, reset, then restore it from the cloud.

  • How can I "clear" my old IPad? I'll sell it and must restart it from the begining as new, create new Apple ID,etc?

    How can I "clear" my old IPad ? I'll sell it and must restart it from the begining as a new one. To leve it as when I had purchased it.

    Settings>General>Reset>Erase All Content and Settings

  • I tried to create a new google calendar in ical, but they did not show up, I tried this several times. Now when I sync my iPad via iTunes all these failed attempts are showing up under the ical sync list in iTunes, how can i clear them from this list?

    I tried to create a new google calendar in ical, but they did not show up, I tried this several times.
    Now when I sync my iPad via iTunes all these failed attempts are showing up under the ical sync list in iTunes, how can I clear them from this list?

    See https://bugs.downthemall.net/ticket/2147
    Google Search Bug
    Reported by: openid:nathan wride Owned by:
    Priority: major Milestone:
    Component: Polish/Usability Version: 2.0.10
    Keywords: Google search instant save bug Cc:
    Operating System: Windows
    Description
    Hi Guys
    I have found a bug/annoying thing that occurs frequently on google. When searching, DTA trys to download the search...
    I'll try to attach a screenshot.
    Attachments
    [https://bugs.downthemall.net/attachment/ticket/2147/Screenshot.png Screenshot.png] Download (113.0 KB) - added by openid:nathan wride 4 weeks ago.
    The screenshot that shows the bug.

  • How can I clear my search-bar?

    How can I clear the information in my search bar? For example, if a web-site such as;
    www.google.com
    is listed on my search-bar how can I delete this site from the search-bar?
    Thanks

    If you mean the Google search bar on the Navigation Toolbar then you need to remove all that history.
    You can right-click the textarea of that search bar and choose "Clear Search History".
    See also:
    * [[Clear Recent History]]
    * http://kb.mozillazine.org/Deleting_autocomplete_entries

  • I deleted all my photos and videos and then delete the deleted files but the photo app is still taking up 12 GB of space and I have no room for new stuff.  How can I clear the memory space used by my deleted videos and photos?

    I deleted all my photos and videos and then delete the deleted files but the photo app is still taking up 12 GB of space and I have no room for new stuff.  How can I clear the memory space used by my deleted videos and photos?  I don't know why the photos are still taking up space and if I will have to reset my phone to get rid of the problem.

    Hey there TowneJ,
    Welcome to Apple Support Communities.
    The article linked below provides troubleshooting tips that’ll likely resolve the issue that you’ve described, where deleted files appear to be taking up space on your iPhone 5.
    If you get a "Not enough free space" alert on your iPhone, iPad, or iPod touch - Apple Support
    So long,
    -Jason

  • How can I clear star up disk - keep getting message that it is almost full

    How can I clear star up disk - keep getting message that it is almost full

    Move the videos and pictures stored on the device to your computer and create more room on the device.

  • When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

    When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

    When I am on my home screen on the iPhone, swipe left to the search page. Put a letter in the search field. then scroll down. eventually you get to all your texts previously deleted or not. The are all there. How can I clear the entire text from the phone

  • Unable to clear inbox, still showing 1 message in inbox on icon when there are no messages in the inbox. How can I clear the 1 message from the icon indicator?

    I am unable to clear 1 message in my email inbox showing on the icon. I have tried clearning out all messages in my inbox and it still shows 1 message remaining unread. I erased messages 5 days ago and since then it has been showing 1 message remaining. How can I clear this from the icon? Thanks

    Ouit Mail app. (Remove from MultiTasking bar).
    Double tap the home button to bring up the multitasking dock. Tap and hold an app. A red badge with a minus symbol will appear on the icons. Tap the minus symbol of Mail app to quit.

  • How can i clear a full time capsule and start again

    how can i clear a full time capsule and start again

    Open the airport utility .. Click on the TC.. click on edit and go to the Disks tab.
    Click Erase Disk.
    Choose quick erase.. it takes 2min to reformat the drive.

  • How can I clear the stored browsing history in iCloud?

    As the headline says, how can I clear the stored browsing history in iCloud?
    After resetting my iPhone, previous history came back as soon as I signed in with iCloud on it. I would really like this to not occur.

    The only place that Thunderbird gets suggested addresses is from your address books. I have seen some not show up in the books because some key info was never stored when the contact was saved.
    Sometimes you can start a new message and when the bad contact shows up select it. Create the message and save it to drafts. Then you can go to the Draft folder open the draft message by right clicking and select Open Message in Tab. Then click the star to the right of the contact and it will open the contact edit button. From there you can delete the contact.
    This does not always work though.

  • 2500 Songs in Downloads on my iPhone - How can I clear them all at once?

    Hi there - I was trying to get my driving playlist on my iPhone before I left (iTunes Match enabled) ... and started downloading 2500 songs. 
    Of course, I ran out of space.  I've since cleared up the space, but now I need to leave, and want to clear my download list.
    I've tried deleting them one-at-a-time, but ... that's going to take hours.
    I've tried turning off match and syncing them (this ultimately got most of the music on my phone, but still have 1400+ songs in the Downloads).
    I've tried signing out of iTunes, and restarting my phone (apparently this worked in iOS5).
    And I still have 1400+ songs waiting to download. 
    I've turned off the cellular download (so I don't get a holiday surprise from Verizon), but ...
    How can I clear the "Pending" Downloads list in iTunes all at once?  There must be a workaround. 

    IrieItes wrote:
    I'm sure there must be a quicker way to relink that image than doing it one by one.
    You should be able to correct that from the Errors tab on the right-hand side of the site window. It should show up as a Missing File. Select it, then point and shoot at the correct image file in the FIles tab on the left-hand side of the site window.
    John

Maybe you are looking for