Skip to content

Commit

Permalink
Merge pull request #285 from pigpigever/master
Browse files Browse the repository at this point in the history
#4 提交实验代码
  • Loading branch information
zengsn authored Oct 28, 2016
2 parents 62c689e + f096bb1 commit d6c49f1
Show file tree
Hide file tree
Showing 2 changed files with 137 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package edu.hzu.javaweb.labs.se1414080902227;

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 Se1414080902227Servlet extends HttpServlet {

/**
* Constructor of the object.
*/
public Se1414080902227Servlet() {
super();
}

/**
* Destruction of the servlet. <br>
*/
public void destroy() {
super.destroy(); // Just puts "destroy" string in log
// Put your code here
}

/**
* 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("Ìá½»³É¹¦");
}

/**
* 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();
}

/**
* Initialization of the servlet. <br>
*
* @throws ServletException if an error occurs
*/
public void init() throws ServletException {
// Put your code here
}

}
54 changes: 54 additions & 0 deletions jweb/web/1414080902227/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%System.out.println("Hello Jsp"); %>
<html>
<head>
<title>高级网页设计</title>
<style type="text/css">
.button_design
{
width: 100px;
height: 50px;
margin:0 auto;
margin: 10px;
position: relative;
left: 50px;
}
.button_div
{
width: 200px;
height: 100px;
margin: 0 auto;
margin-top: 100px;
}
.border_design
{
border: 3px solid gray;
width: 500px;
height: 400px;
margin: 0 auto;
}
</style>
</head>
<body>
<div>
<fieldset class="border_design" >
<legend align="center">手机销售系统</legend>
<div class="button_div">
<div>
<input type="button" value="创建手机订单" class="button_design">
</div>
<div>
<input type="button" value="录入售后信息" class="button_design">
</div>
<div>
<a href="1414080902227" style="margin: 80px;">提交</a>
</div>
</div>

</fieldset>

</div>
</body>
</html>

0 comments on commit d6c49f1

Please sign in to comment.