-
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 #285 from pigpigever/master
#4 提交实验代码
- Loading branch information
Showing
2 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
jweb/src/edu/hzu/javaweb/labs/se1414080902227/Se1414080902227Serverlet.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,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 | ||
} | ||
|
||
} |
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,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> |