AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

timeout di una sessione

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian)
View previous topic :: View next topic  
Author Message
SteMan
Guest





PostPosted: Thu Jul 24, 2003 9:46 am    Post subject: timeout di una sessione Reply with quote



scusate se provo a ripetere il quesito di 2 giorni fà, ma essendo alle prime
armi nel campo di applicazioni AS ho paura di dire anche delle corbellerie.

Ho iniziato a sviluppare una applicazione web con utilizzo di servlet.
Gestisco la id session utilizzando attributi di sessione. Ho anche
impostato un timeout
nel web.xml tramite il tag session-timeout. Tutto funziona regolarmente ma
vorrei intercettare la chiusura per inattività (session-timeout) per
liberare ad esempio il login in atto, e per avvertire che la sessione è
scaduta. Quando effettuo il logout eseguo la invalidate della sessione
(cosa che avviene automaticamente per timeout) e sblocco l'utente come login
attivo (cosa che vorrei fare intercettando il timeout).

Sapete darmi un consiglio?? :-)

grazie

Stefano


Back to top
Kazuma
Guest





PostPosted: Thu Jul 24, 2003 12:27 pm    Post subject: Re: timeout di una sessione Reply with quote



Quote:
Sapete darmi un consiglio?? Smile

Beh, potresti utilizzare i vari listener che sono presenti all'interno delle
Servlet API. Nel tuo caso dai una occhiata a queste interfacce:

javax.servlet.http.HttpSessionListener
javax.servlet.http.HttpSessionBindingListener
javax.servlet.http.HttpSessionAttributeListener
javax.servlet.http.HttpSessionActivationListener


Regards,
Kazuma


--
I've got nothing against God. It's his fan club I can't stand.

Alex "Kazuma" Garbagnati, http://www.kazuma.net
EJB & Tomcat jGuru FAQ Manager, http://www.jGuru.com
Tutor "Progetto Scuole", http://www.JIA.it
Java Italian Association - SUN - MIUR



Back to top
SteMan
Guest





PostPosted: Thu Jul 24, 2003 3:20 pm    Post subject: Re: timeout di una sessione Reply with quote



Kazuma sei un grande!!

ho utilizzato HttpSessionListner il quale possiede due metodi:
"sessionCreated" e "sessionDestroyed". Questi eventi si attivano quando
viene creata la sessione e quando viene invalidata, per timeout o per altro
motivo. Deve anche essere aggiunto nel file web.xml il tag <listener> e
<listener-class> con la classe che implemeta HttpSessionListner e gestisce i
metodi suddetti.
Obiettivo raggiunto!
grazie, ciao
Stefano

"Kazuma" <JIA (AT) kazuma (DOT) net.us> ha scritto nel messaggio
news:7hQTa.200407$Ny5.5690519 (AT) twister2 (DOT) libero.it...
Quote:
Sapete darmi un consiglio?? :-)

Beh, potresti utilizzare i vari listener che sono presenti all'interno
delle
Servlet API. Nel tuo caso dai una occhiata a queste interfacce:

javax.servlet.http.HttpSessionListener
javax.servlet.http.HttpSessionBindingListener
javax.servlet.http.HttpSessionAttributeListener
javax.servlet.http.HttpSessionActivationListener


Regards,
Kazuma


--
I've got nothing against God. It's his fan club I can't stand.

Alex "Kazuma" Garbagnati, http://www.kazuma.net
EJB & Tomcat jGuru FAQ Manager, http://www.jGuru.com
Tutor "Progetto Scuole", http://www.JIA.it
Java Italian Association - SUN - MIUR





Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.