Scienze  
Syllabus ItalianoSyllabus IngleseindexlogoutArea Personale UNITN
Sistemi distribuiti: design Forum del Corso Messaggi del Thread
 
Sistemi distribuiti: design - Forum del Corso
Messaggi del Thread

Autore Messaggio
gianni.costanzi
Thread
  Post Postato: 21 gennaio 2005
   Titolo: HttpSession
 

This time I have no new problems, it's just a curiosity about HttpSession and the implicit jsp object called session..
When we are dealing with servlets, we can retrieve the HttpSession object from the request object and with an optional boolean flag we can say that if there is no active session we want a new one to be created.. 
In JSP pages we have the 'session' implicit object, that we can use to retrieve session attributes for example.. My question is:
while with servlets we must create the session (with request.getSession(true), if I remember well) if we want to use it, what happens with JSPs? Is the session created automatically the first time we access the implicit object related to the session?

Thank you!
marco.ronchetti
  Post Postato: 21 gennaio 2005
   Titolo: Re: HttpSession
 

I believe a session is ALWAYS created for JSP pages unless you explicitly request the container not to do it.
In the @page directive, you can indicate that you do not need sessions, in which case the "session" variable will not be made available.
gianni.costanzi
  Post Postato: 22 gennaio 2005
   Titolo: Re: HttpSession
 

Thank you
 
Progetto eLeaf
Contact eLeaf team