I have a JSP named process.jsp.Upon clicking on a command in my application a popup will open with some data to select ,after I select the data and click on submit ,procees.jsp will be called where I have to process the data and store to database.In process.jsp,I have try catch block.suppose if any exception is thrown in try block it should be caught in catch block and an alert message should be displayed as "processing failed" and parent window should be refreshed after closing the popup.the code looks like below
<%
try{
int a=1/0;
}catch(Exception ex){
ex.printStackTrace();
%>
<script>alert("process fialed");
window.close();
parent.loaction.href=parent.loaction.href;
</script>
<%
}%>
I tried with above code,but none of the script code lines got executed.Can any one help me out. Thanks in advance