Originally posted by Yamini Krishnamurthi:
Hi All
I am using EJB to connect to SAP through an intermediate interface of Java classes. All the exceptions raised at the various stages, I am having them thrown back to the JSP. I need to catch the exceptions in my JSP and pop it up as an alert. How do I do it?
Thanks in advance
Yamini
hi yamini,
i have a code fragment which i hope will satisfy your requirements....
<%@ page language="java" import="java.sql.*" %>
<html>
<body>
<%
try
{
throw new Exception();
}
catch(Exception e)
{
%>
<script lanugage=javascript>
alert("Exception");
</script>
<%
}
%>
</body>
</html>
this is a jsp code which has a try-catch block. the try block throws an exception which is caught and a alert box is displayed. execute this code and check if you get what u want...
bye
Mnk