Solution:
The files used to run the application are:
1. Nullexception.jsp
2. errorpage.jsp
//Nullexception.jsp
<%@ page errorPage="errorpage.jsp" import="java.util.Vector"%>//errorpage.jsp
<html>
<head>
</head>
<%! Vector vec = null; %>
<body bgcolor=#ffffff>
Vector has <%= vec.size() %> elements.
</body>
</html>
<html>
<%@ page isErrorPage="true" %>
The exception <font color="red"> <%= exception.getMessage() %> </font> has occurred.
</body>
</html>
The output of the program is as shown in Figure 10.6.
0 nhận xét:
Post a Comment