静态页面提交到jsp页面时,出现下载要提交的jsp页面,怎么回事?菜鸟求解
静态页面:</head>
<body>
<form action="ShowAirline.jsp" method="get">
出发城市<input type="text" name=Departure/><br>
目的城市<input type="text" name=Destination/><br>
出发日期<input type="text" name=Date/><br>
<input type="button" name=submit value=查询 />
</form>
</body>
</html>
JSP页面:
<%@page language="java" contentType="text/html charset=utf-8" pageEncoding="utf-8"%>
<%@page import="java.util.LinkedList"%>
<%@page import="Service.ShowAirline"%>
<!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=utf-8">
<title>查询结果<title>
</head>
<body>
<%
String Departure = request.getParameter("Departure");
String Destination = request.getParameter("Destination");
String departureDate = request.getParameter("Date");
if(Departure == null){
Departure = "";
}
if(Destination == null){
Destination = "";
}
if(departureDate == null){
departureDate = "";
}
ShowAirline show = new ShowAirline();
LinkedList Airline_info = show.Search();
int i = 0;
int sum = Airline_info.size();
String info[] = new String[sum];
while(i < sum){
info[i] = (String)Airline_info.get(i);
i++;
}
for(i = 0; i < sum; i++){
String each_info[] = info[i].split("|");
%>
<table border="" align="center">
<tr>
<td>航班</td><td>出发地</td><td>目的地</td><td>出发日期</td><td>票数</td><td>价格</td>
</tr>
<br>
<%
if(each_info[1]==Departure && each_info[2]==Destination && each_info[3]==departureDate){
%>
<tr>
<td><%=each_info[0]%></td>
<td><%=each_info[1]%></td>
<td><%=each_info[2]%></td>
<td><%=each_info[3]%></td>
<td><%=each_info[4]%></td>
<td><%=each_info[5]%></td>
</tr>
<br>
</table>
<%
}
}
%>
<form action="Serice.purchase" method="get">
请输入航班号<input type="text" name=id/><br>
请输入购买票数<input type="text" name=number/><br>
<input type="button" name=submit/>
</form>
</body>
</html> --------------------编程问答-------------------- 我觉得你是不是没有用tomcat等java web容器服务器来运行你的代码??
补充:Java , Web 开发