Originally posted by amit punekar:
Hi,
Can you please post the code and web.xml to have a look at ?
Thank you Amit..
Here you go
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"<br /> xmlns="http://java.sun.com/xml/ns/j2ee"<br /> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"<br /> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee " target="_blank" rel="nofollow">http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>MySQLTestWebProject</display-name>
<listener>
<description>
HttpSessionListener for SessionInvalidate test
</description>
<display-name>LMRASessionListener</display-name>
<listener-class>
test.servlet.listener.session.invalidate.LMRASessionListener
</listener-class>
</listener>
<servlet>
<description></description>
<display-name>MyServlet</display-name>
<servlet-name>MyServlet</servlet-name>
<servlet-class>
test.servlet.listener.session.invalidate.MyServlet
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>MyServlet</servlet-name>
<url-pattern>/MyServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<resource-ref id="MySQLResourceRef">
<description>
</description>
<res-ref-name>jdbc/mysqldsref</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
</web-app>
Note: As the web.xml elements are not getting displayed corrected if i use Code Tags, i used Quote tags here!
Also when do you expect the session is getting destroyed?
Is it when or what? I think it should have been intended for 'what'. I do expect an database call to be invoked (say a lock on an user has to be released when the session gets destroyed). [The lock is obtained on the sessioncreated for the logged in user).
May be you can try the same code only for HttpSessionListener on Tomcat and check if it works correctly.
Yes i did check the same in Tomcat (inside Netbeans IDE) and it works so perfectly!
But
NOT in WAS! [Edited because all tags/elements in web.xml were not getting displayed
]
[ January 24, 2008: Message edited by: Raghavan Muthu ]
[ January 24, 2008: Message edited by: Raghavan Muthu ]