java代码015

code015.jsp

<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>setAttribute和getAttribute</title>
</head>
<body>
<%
try
{
    int money = 100;
    int number = 0;
    request.setAttribute("result", money / number);
}
catch(Exception e)
{
    request.setAttribute("result", "除数不能为0,页面出现异常");    
}

%>
<jsp:forward page="code016.jsp" />
</body>
</html>

评论

h
hw_7864

⭐️ Admin快速开发: https://show.cool-admin.com/

赞 0
h
hw_7864

⭐️ 官方文档: https://cool-js.com

赞 0
h
hw_7864

⭐️ chatgpt在线体验: https://cool-js.com/ai/chat-vip/index.html?r=helloworld

赞 0