-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #361 from bestwayr/master
- Loading branch information
Showing
3 changed files
with
134 additions
and
3 deletions.
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
jweb/src/edu/hzu/javaweb/labs/se1414080902202/Se1414080902202Servlet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
<input type="checkbox"name="way2"value="A2"><font size="4"color="#ff6600">出租车</font></input> | ||
<input type="checkbox"name="way3"value="A3"><font size="4"color="#ff6600">专车</font></input> | ||
<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> |
This file was deleted.
Oops, something went wrong.