Hello Daniel,

The preserve list could be upto your implementation. It could be a 
Delimited String which you read from a property file and you can store it 
in a ArrayList.

Loop the arrayList, get the entires, and compare it with the Session 
Attributes

session.getAttributeName ().

If they match, dont remove. If they dont match, remove. This should be a 
simple logic.

Thanks and regards,
Pazhanikanthan. P (Paz)

Consultant for AXA,
Senior Software Engineer,
HCL Australia Services Pty. Ltd.
Off   : +61-3-9618-4085
Mob : +61-0411-354-838




"Daniel Chacón Sánchez" <[EMAIL PROTECTED]>
26/09/2006 08:41 AM
Please respond to "Struts Users Mailing List"
 
        To:     "Struts Users Mailing List" <user@struts.apache.org>, 
[EMAIL PROTECTED]
        cc: 
        Subject:        Re: Erase Only some Session Objests and variables


What do you suggest me to use for keep that "preserve" names? A file, an
arrayList, or what? An example code of the use of that with the code that
Heidy gived??


2006/9/25, Jason King <[EMAIL PROTECTED]>:
>
> Daniel Chacón Sánchez wrote:
> > son = some :P
> >
> > 2006/9/25, Daniel Chacón Sánchez <[EMAIL PROTECTED]>:
> >>
> >> Hi all,
> >>
> >> How I can kill son objects and variables in session, without kill
> >> everything in session like with session.invalidate().
> >>
> >> I want that some objects always be in session and when I press a menu
> >> option all other variables or object that are in session be erase.
> >>
> >> i can´t use removeAttribute(..); because I don´t know the name of all
> >> objects and variables that be in session in a moment. I need to erase
> >> everything from sesion except son object that always need in session,
> >> how
> >> can i do that?
> >>
> >> I'm using struts framework
> >>
> >
> Since the session object is a map you could get a list of keys and for
> each key compare it to your list of "preserve" names.  If its not in the
> name, remove it.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

_____________________________________________________________________ 
This e-mail has been scanned for viruses by MCI's Internet Managed 
Scanning Services - powered by MessageLabs. For further information 
visit http://www.mci.com

*********************************************************************************
Important Note
This email (including any attachments) contains information which is 
confidential and may be subject to legal privilege.  If you are not 
the intended recipient you must not use, distribute or copy this 
email.  If you have received this email in error please notify the 
sender immediately and delete this email. Any views expressed in this 
email are not necessarily the views of AXA.   Thank you.
**********************************************************************************

Reply via email to