jsp包
========================================
1.index.jsp
------------------------------
这个在web下,web-inf外面。别的都在web-inf下,在web-inf下的会被隐藏,用户不能直接看到
-------------------------------
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>$Title$</title>
</head>
<body>
<a href="${pageContext.request.contextPath}/tologin">跳转到登录</a>
</body>
</html>
========================================
2.addbooks.jsp
------------------------------
在web-inf下
-------------------------------
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>添加图书</title>
</head>
<body>
<form action="${pageContext.request.contextPath}/add">
图书名称:<input type="text" name="bookName"><br>
图书数量:<input type="text" name="bookCounts"><br>
图书细节:<input type="text" name="detail"><br>
<button type="submit">增加</button>
</form>
</body>
</html>
========================================
3.books.jsp
------------------------------
在web-inf下,含有分页
-------------------------------
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="
http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
<title>Title</title>
</head>
<body>
<span>现在登录的用户是</span>
<span>${username}</span>
<a href="${pageContext.request.contextPath}/unlogin">注销</a>
<form action="${pageContext.request.contextPath}/select/1">
<input type="text" name="bookName" placeholder="请输入要查找的商品">
<button type="submit">搜索</button>
</form>
<table>
<thead>
<tr>
<th>图书ID</th>
<th>图书名称</th>
<th>图书数量</th>
<th>图书简介</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<c:forEach var="books" items="${page.list}">
<tr>
<td>${books.bookID}</td>
<td>${books.bookName}</td>
<td>${books.bookCounts}</td>
<td>${books.detail}</td>
<td>
<a href="${pageContext.request.contextPath}/toupdate/${books.bookID}">修改</a>
<a href="${pageContext.request.contextPath}/delete/${books.bookID}">删除</a>
</td>
</tr>
</c:forEach>
</tbody>
</table>
<a href="${pageContext.request.contextPath}/toadd">增加</a>
<div>
<div>
<a href="/books/${page.getNavigateFirstPage()}">首页</a>
</div>
<div c:if="${page.hasPreviousPage}">
<a href="/books/${page.prePage}">上一页</a>
</div>
<span>当前页数:${page.pageNum}</span>
<div c:if="${page.hasNextPage}">
<a href="/books/${page.nextPage}">下一页</a>
</div>
<div>
<a href="/books/${page.getNavigateLastPage()}">尾页</a>
</div>
</div>
</body>
</html>
========================================
4.login.jsp
------------------------------
在web-inf下
-------------------------------
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>登录页面</title>
<link rel="stylesheet" href="/static/css/bootstrap.css">
<script src="/static/js/bootstrap.js"></script>
</head>
<body>
<form action="${pageContext.request.contextPath}/login">
<div class="form-group">
<label for="exampleInputEmail1">Email address</label>
<input type="text" name="username" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp">
<small id="emailHelp" class="form-text text-muted">We'll never share your email with anyone else.</small>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" name="password" class="form-control" id="exampleInputPassword1">
</div>
<div class="form-group form-check">
<input type="checkbox" class="form-check-input" id="exampleCheck1">
<label class="form-check-label" for="exampleCheck1">Check me out</label>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</body>
</html>
========================================
4.updatebooks.jsp
------------------------------
在web-inf下
-------------------------------
<html>
<head>
<title>更改图书</title>
</head>
<body>
<form action="${pageContext.request.contextPath}/update">
图书ID:<input type="text" value="${books.bookID}" name="bookID"><br>
图书名称:<input type="text" value="${books.bookName}" name="bookName"><br>
图书数量:<input type="text" value="${books.bookCounts}" name="bookCounts"><br>
图书细节:<input type="text" value="${books.detail}" name="detail"><br>
<button type="submit">修改</button>
</form>
</body>
</html>