Hi all,
I m preparing for SCWCD EE5(310-083) and while preparing came across sessions management.
i also understood listeners of all types.
including 'HttpSessionActivationListener '
i did all practicals regarding all other listeners and its all working great
but HttpSessionActivationListener is where i am not really clear.
first of all it defines two metods
public void sessionWillPassivate(HttpSessionEvent e) &
public void sessionDidActivate(HttpSessionEvent e)
now from whatever i read it stats that above both methods will get called by container when a session moves from one JVM TO ANOTHER JVM.
i guess it means to different web containers (2
tomcat severs running on localhost on different port)
So i tried
testing this practically on my system with two different tomcat running (tomcat5.5 & tomcat6.0)
i created a Session through
servlet and then once session is created i try to transfer the request to the other JVM(tomcat) hoping that the session will also get transferred but it does not get moved to second JVM.
following is code what i thought will work :
Simple HTML form
web.xml
Implementing Class
First Servlet
Second Servle
now i had deployed this entire web application on two server on local machine
Tomcat 6 :8085
Tomcat 5 :8080
and i was hoping that after creating session on Tomcat 6 :8085 when i will move to Tomcat 5 :8080 by link (i also did encoding for that) my session should also move from JVM1 Tomcat6 to JVM2 Tomcat5.
it didnt work on did not get my old session on other server.
is this a correct way to test this concept??
am i doing something stupid with all of this??
i was just trying to test it ??
please help . sorry for making you all read so much.......