<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Flights Search Page</title>
</head>
<body>
<h1>Flights Search Page</h1>
</br>
<!-- (post)using a form -->
<form method="post"
action="${pageContext.request.contextPath }/flightcontroller">
Flight Numeber <input type="text" name="fn" value="Flight Numeber"><br/>
Flight Departure Date <input type="text" name="fdd" value="Flight Departure Date"><br/>
Flight Departure City <input type="text" name="fdc" value="Flight Departure City"><br/>
<input type="submit" value="Search Flights">
</form>
<br/>
<!-- only display the table after user click the submit button(request) -->
<!-- check whether flist is null -->
<c:if test="${requestScope.flist ne null}">
<table border="1">
<tr>
<th>Flight Id</th>
<th>Departure</th>
<th>Departure Date</th>
<th>Arrival</th>
<th>Arrival Date</th>
</tr>
<c:forEach var="flight" items="${requestScope.flist}"
varStatus="Status">
<tr>
<td>${flight.idFlight}</td>
<td>${flight.depatureCity}</td>
<td>${flight.depature}</td>
<td>${flight.arrivalcity}</td>
<td>${flight.arrival}</td>
</tr>
</c:forEach>
</table>
</c:if>
</body>
</html>
<%-- <!-- (get)using uri -->
Flight Numeber <input type="text" name="fn" value="Flight Numeber"></br>
Flight Departure Date <input type="text" name="fdd" value="Flight Departure Date"></br>
Flight Departure City <input type="text" name="fdc" value="Flight Departure City"></br>
<a href="${pageContext.request.contextPath }/flightcontroller?fn>=${fn}&fdd=${fdd}&fdc=${fdc}">Search Flights</a>
//how to get param form input to apend to the url ?may be not in this way, but the concept is like this : fn>=${fn}&fdd=${fdd}&fdc=${fdc}
--%>
FlightView.jsp
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 原因:找不到编译后的jsp,编译后的jsp都在路径在work目录下,编译不到,可以清除work目录下重启tomca...
- 一、Jsp Model1 1、传统Jsp Model1模型 2、改进后的Jsp Model1模型 二、Jsp Mo...