A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Removing session attributes with regex
Joined: Sep 29, 2010
Oct 16, 2012 09:44:17
I need to remove all the session attributes based on a
Ex: Attribute keys being: book_firefox, book_chrome, etc.
Is there a way to remove all the attributes that start with book_* in a single statement.
) takes a single string as parameter, so how to achieve this?
Joined: Mar 14, 2010
Oct 16, 2012 09:54:33
One possible way is using getAttributeNames() to get all the objects and iterate over these and check the key, and if the object key is matching your regex validation, remove this object.
SCJP 1.6,Preparing (Tryin to prepare) for scwcd
I agree. Here's the link:
subject: Removing session attributes with regex
Passing request object...
question from JWebplus1.4 about session.invalidate()
HFSJ Book mock exam question ? context attribute confussion ?
Session time-out notification
sessions in Struts 1.3
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015