Skip to content

Commit

Permalink
Merge pull request #293 from oldslave/master
Browse files Browse the repository at this point in the history
#4 提交实验代码
  • Loading branch information
zengsn authored Oct 28, 2016
2 parents a4fd4e8 + 8206375 commit 9fa4a03
Show file tree
Hide file tree
Showing 3 changed files with 119 additions and 0 deletions.
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
}

}
51 changes: 51 additions & 0 deletions jweb/web/1414080902238/index.jsp
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>
11 changes: 11 additions & 0 deletions jweb/web/1414080902238/info.jsp
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>

0 comments on commit 9fa4a03

Please sign in to comment.