Skip to content

Commit

Permalink
Merge pull request #361 from bestwayr/master
Browse files Browse the repository at this point in the history
#4  #109 重新提交实验代码
  • Loading branch information
zengsn authored Nov 5, 2016
2 parents d959495 + f3130ee commit e77963c
Show file tree
Hide file tree
Showing 3 changed files with 134 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
package edu.hzu.javaweb.labs.se1414080902202;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Se1414080902202Servlet extends HttpServlet {

/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
out.println("计价规则是:起步价5元,超过2公里,每公里2元,以此累加。累加金额超过50,则减少5元。");

}

/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
out.print(" This is ");
out.print(this.getClass());
out.println(", using the POST method");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}

}
74 changes: 74 additions & 0 deletions jweb/web/1414080902202/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<%@ page language="java" import="java.util.*" contentType="text/html;charset=utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
<meta charset="utf-8">
<!-- 新 Bootstrap 核心 CSS 文件 -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
<!-- 可选的Bootstrap主题文件(一般不用引入) -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap-theme.min.css">
<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>
<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="index.js"></script>
<style type="text/css">
body{
background-color:#FFCC00;
}
.text2{border:3px;width:350px;height:50px;font-size:16px;line-height:1.6;}
.bt{
width:100px;
}
</style>
<head>
<title>某滴出行网。</title>
</head>

<body bgcolor="yellow">
<form action=""method="post"id="target">
<p >
<font size="6"color="#FFFFFF">某滴欢迎您~</font>
</p>
<hr size="15px" noshade>
<p align="center"><font size="5"color="#ffffff"><b>您好,您现在要去哪儿?</b></font></p>
<ul>
<li>
<p>
<a href="http://developer.baidu.com/map/carhome.htm"><font size="5"color="#ffffff">您现在在哪?(查看定位)</font></a>
</p></li>
<br>
<li>
<p>
<a href="http://developer.baidu.com/map/carhome.htm"><font size="5"color="#ffffff">您要去哪儿?</font></a>
</p>
</li>
</ul>
<hr size="15px" noshade>
<p>
<font size="5"color="#ffffff"><b>您想搭乘:</b></font>
</p>
<p>
<input type="checkbox"name="way1"value="A1"><font size="4"color="#ff6600">快车</font></input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox"name="way2"value="A2"><font size="4"color="#ff6600">出租车</font></input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox"name="way3"value="A3"><font size="4"color="#ff6600">专车</font></input>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="checkbox"name="way4"value="A4"><font size="4"color="#ff6600">顺风车</font></input>
</p>
<p align="center">
<a href="1414080902202"><font size="5"color="#ffffff">计价规则</font></a>
</p>
<br>
<p align="center">
<input style="background:#ffffff;color:black;width: 250px; height: 50px;"type="submit"class="btn"id="button1"value="呼叫快车"></input>
</p>
<br>
<p>
<font size="5"color="#ffffff"><b>祝您乘坐愉快!*—*</b></font>
</p>
</form>
</body>
</html>
3 changes: 0 additions & 3 deletions jweb/web/META-INF/MANIFEST.MF

This file was deleted.

0 comments on commit e77963c

Please sign in to comment.