V
Vasu
Hi
i have a web application that is developed suign struts. When the user
clicks the 'X' button in the window, i want to move to an action class
that performs a database update and then has to close the window.
Kindly help.
Let me know if theres any issue with teh code below:
JSP
-------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script>
function doUnload(){
if (window.event.clientX < 0 && window.event.clientY < 0) {
alert("Window is closing...");
document.form.action="logout.do";
}
}
</script>
</head>
<body onunload="doUnload()">
<a href="http://www.yahoo.com">Yahoo</a>
</body>
</html>
Struts-config.xml
-----------------------------
<action path="/logout"
type="com.bt.osat.actions.ActionProductStatus"
scope="session"
<forward name="failure" path="/jsp/failure.jsp"/>
<forward name="Invalid"
path="/jsp/NoAuthentication.jsp"/>
<forward name="sessionexpired"
path="/jsp/sessionexpired.jsp"/>
</action>
Thanks in advance.
Regards,
Vasu
i have a web application that is developed suign struts. When the user
clicks the 'X' button in the window, i want to move to an action class
that performs a database update and then has to close the window.
Kindly help.
Let me know if theres any issue with teh code below:
JSP
-------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
<script>
function doUnload(){
if (window.event.clientX < 0 && window.event.clientY < 0) {
alert("Window is closing...");
document.form.action="logout.do";
}
}
</script>
</head>
<body onunload="doUnload()">
<a href="http://www.yahoo.com">Yahoo</a>
</body>
</html>
Struts-config.xml
-----------------------------
<action path="/logout"
type="com.bt.osat.actions.ActionProductStatus"
scope="session"
<forward name="success" path="/jsp/logout.jsp"/>
<forward name="failure" path="/jsp/failure.jsp"/>
<forward name="Invalid"
path="/jsp/NoAuthentication.jsp"/>
<forward name="sessionexpired"
path="/jsp/sessionexpired.jsp"/>
</action>
Thanks in advance.
Regards,
Vasu