1、数据库设计:
total_station
id; 序号
routine; 线路
sta_routine; 第几站
station; 站名
页面设计
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>标签:总结,center,text,align,3.14,查询,width,margin,双人 From: https://www.cnblogs.com/jy-all-bug/p/17213821.html
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>地铁站查询</title>
</head>
<style type="text/css">
button{
color: gold;
background-color: mediumaquamarine;
text-align: center;
font-size:20px;
height: 35px;
width: 10%;
margin-left:45%;
margin-bottom: 50px;
}
h1{
text-align: center;
width: 500px;
margin: 50px auto;
}
h3{
text-align: center;
width: 500px;
margin: 10px auto;
}
table{
text-align: center;
margin-left:40%;
}
</style>
<body text="#ffe4c4" bgcolor="#fff0f5" background="img.png">
<form action="ResearchServlet" method="post">
<h1>线路查询</h1>
<input type="hidden" name="Method" value="XLCX"><br>
<h3>请输入线路号:<input type="text" name="routine"></h3><br>
<button type="submit">查询</button>
<table border="0" cellspacing="10" width="20%" >
<c:forEach items="${totalStations1}" var="totalStation1" varStatus="id1">
<tr align="center">
<td>${totalStation1.getSta_routine()}</td>
<td>${totalStation1.getStation()}</td>
</tr>
</c:forEach>
</table>
</form>
<form action="ResearchServlet" method="post">
<h1>站点查询</h1>
<input type="hidden" name="Method" value="ZDCX"><br>
<h3>请输入站点号:<input type="text" name="station"></h3><br>
<button type="submit">查询</button>
<table border="0" cellspacing="10" width="20%" >
<c:forEach items="${totalStations2}" var="totalStation2" varStatus="id2">
<tr align="center">
<td>${id2.count}</td>
<td>${totalStation2.getRoutine()}</td>
</tr>
</c:forEach>
</table>
</form>
<form action="ResearchServlet" method="post">
<h1>起点-终点查询</h1>
<input type="hidden" name="Method" value="SECX"><br>
<h3>请输入起点:<input type="text" name="station1"></h3><br>
<h3>请输入终点:<input type="text" name="station2"></h3><br>
<button type="submit">查询</button>
</form>
</body>
</html>