Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript to reach inside a servlet...

 
Aris Petridis
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I hope this question is not very much off topic... I have a button on my main page which is used for logging out (for time being all it does is confirm and close the browser..). What I would like to do is somehow through that function, access a static Vector of all logged in users I am keeping in a servlet, and remove that user... Two things I don't know here... How can I (can I???) grab the user's id from a cookie that is stored previously by a servlet onto the browser of the user, and secondly, how to remove an entry with that name from the Vector...
I know this can most probably not be done simply through the javascript, so I know I might have to submit a form and call a servlet to do the job... but I don't want to have a different page saying goodbye and all that... If you got any ideas how this can be done as quickly (and easily) as possible pls drop me a few lines... Thank you,
Regards,
Aris
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai!
U can maintain vactor of users in Servlet context(Add to vector whenever he logs in) and can delete when he logs out...
I think by this way u can handle logout tracking...
Rgds
Manohar
 
Aris Petridis
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, but how do I do this thru a javascript function inside a jsp??
 
Thomas Mcfarrow
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have the javascript do a submit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic