1.设计主页
main.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<frameset rows="15%,*">
<frame src="top.jsp">
<frameset cols="12%,*">
<frame src="main_left.jsp">
<frame src="main_right.jsp" name="main_right">
</frameset>
</frameset>
<body>
</body>
</html>
2.设计标题
top.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<div align="center">
<h1 style="color:red">家庭记账本小程序</h1>
</div>
</body>
</html>
3.设计左侧菜单功能区
main_left.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style type="text/css">
.a{
font-size:20px;
margin-top:10px;
}
</style>
</head>
<body>
<div align="center">
<div class="a">
<a href="add.jsp" target="main_right">新增消费账单</a></div>
<div class="a">
<a href="ShangServlet?method=delete" target="main_right">删除消费账单</a></div>
<div class="a">
<a href="ShangServlet?method=list" target="main_right">修改消费账单</a></div>
<div class="a">
<a href="search.jsp" target="main_right">查询消费账单</a></div>
<div class="a">
<a href="ShangServlet?method=show" target="main_right">查看所有账单</a></div>
</div>
</body>
</html>
4.设计右侧显示区(即空白页)
main_right.jsp
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
</body>
</html>
效果显示为下图: