-
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 #293 from oldslave/master
#4 提交实验代码
- Loading branch information
Showing
3 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
57 changes: 57 additions & 0 deletions
57
jweb/src/edu/hzu/javaweb/labs/se1414080902238/Se1414080902238Servlet.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,57 @@ | ||
package edu.hzu.javaweb.labs.se1414080902238; | ||
|
||
import java.io.IOException; | ||
//import java.io.PrintWriter; | ||
|
||
import javax.servlet.ServletException; | ||
import javax.servlet.annotation.WebServlet; | ||
import javax.servlet.http.HttpServlet; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
@WebServlet("/1414080902238") | ||
public class Se1414080902238Servlet extends HttpServlet { | ||
|
||
|
||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
|
||
public Se1414080902238Servlet() { | ||
super(); | ||
} | ||
|
||
|
||
public void destroy() { | ||
super.destroy(); // Just puts "destroy" string in log | ||
// Put your code here | ||
} | ||
|
||
|
||
public void doGet(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
|
||
String khName=request.getParameter("stuName"); | ||
String phoneNamber=request.getParameter("phoneName"); | ||
String info=""; | ||
if(khName.isEmpty()||phoneNamber.isEmpty()){ | ||
info="输入不能为空!"; | ||
}else{ | ||
info="客户: "+khName+" "+"联系电话: "+phoneNamber; | ||
} | ||
request.setAttribute("outputMessage",info); | ||
request.getRequestDispatcher("/info.jsp").forward(request, response); | ||
} | ||
|
||
|
||
public void doPost(HttpServletRequest request, HttpServletResponse response) | ||
throws ServletException, IOException { | ||
|
||
doGet(request, response); | ||
} | ||
|
||
|
||
public void init() throws ServletException { | ||
// Put your code here | ||
} | ||
|
||
} |
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,51 @@ | ||
<%@ page language="java" contentType="text/html; charset=utf-8" import="java.util.*" pageEncoding="utf-8"%> | ||
<% | ||
String path = request.getContextPath(); | ||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
%> | ||
|
||
|
||
<html> | ||
<head> | ||
<title>汽车4S店管理系统</title> | ||
<!-- 新 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> | ||
<meta charset="utf-8"> | ||
<script src="index.js" type="text/javascript"></script> | ||
<script language="javascript"> | ||
function cancle(){ | ||
window.alert("成功取消"); | ||
} | ||
</script> | ||
</head> | ||
<body> | ||
<h3 align="center">创建客户订单</h3> | ||
<form name="cj" action=""> | ||
<table> | ||
<tr><td>客户姓名:</td><td><input type="text" name="stuName"></td></tr> | ||
<tr><td>客户电话:</td><td><input type="text" name="phoneName"></td></tr> | ||
<tr><td>所购车辆:</td><td colspan="2"><input type="file"></td></tr> | ||
<tr><td>付款情况:</td> | ||
<td colspan="2"> | ||
<input type="checkbox" name="yes">已付款 | ||
<input type="checkbox" name="no">未付款 | ||
</td> | ||
</tr> | ||
<tr><td> | ||
<input type="submit" id="save" value="保存"> | ||
</td> | ||
<td><button type="button" onclick="cancle()">取消</button></td> | ||
</tr> | ||
</table> | ||
</form> | ||
</body> | ||
</html> |
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,11 @@ | ||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> | ||
|
||
|
||
<html> | ||
<head> | ||
<title>显示结果页面</title> | ||
</head> | ||
<body> | ||
<%=request.getAttribute("outputMessage")%> | ||
</body> | ||
</html> |