Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#3 提交实验代码 #52 #320

Merged
merged 3 commits into from
Oct 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package edu.hzu.javaweb.labs.se1414080902224;

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("/1414080902224")
public class Se1414080902224Servlet extends HttpServlet {


private static final long serialVersionUID = 1L;


public Se1414080902224Servlet() {
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 {

response.setContentType("text/html");
PrintWriter out = response.getWriter();;
out.println("ok");

}


public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();;
out.println("ok");
}


public void init() throws ServletException {
// Put your code here
}

}
18 changes: 18 additions & 0 deletions jweb/web/1414080902224/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="3.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>Se1414080902224Servlet</servlet-name>
<servlet-class>edu.hzu.javaweb.labs.se1414080902224.Se1414080902224Servlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Se1414080902224Servlet</servlet-name>
<url-pattern>/1414080902224</url-pattern>
</servlet-mapping>

</web-app>
29 changes: 10 additions & 19 deletions labs/1414080902224/index.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@

<!DOCTYPE html>
<html>
<head>
<title>ѡ���Ӱ���</title>

<head>
<title>�����ʼ�</title>
<!-- �� Bootstrap ���� CSS �ļ� -->
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">

Expand All @@ -16,18 +13,12 @@
<!-- ���µ� Bootstrap ���� JavaScript �ļ� -->
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="index.js" type="text/javascript"></script>
</head>

<body>
��ӭ����<br>
<form action="listForm_result.jsp" method="post">
����ѡ��Ҫ�ۿ��ĵ�Ӱ���:<BR>
<select name="fav" multiple>
<option value="1">�ֲ�Ƭ</option>
<option value="2">����Ƭ</option>
<option value="3">�ƻ�Ƭ</option>
</select>
<button type="button" class="btn btn-default">ȷ��</button>
</form>
</body>
</head>
<body>
<form>
�����ʼ�:<br>
<textarea rows="10" cols="50"></textarea>
<button type="button" class="btn btn-default">����</button>
</form>
</body>
</html>
2 changes: 1 addition & 1 deletion labs/1414080902224/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$(function(){
$( ".btn" ).click(function( event ) {
alert( "确定" );
alert( "ok" );
$.ajax({
url: "ok.json"
}).done(function(data) {
Expand Down
26 changes: 26 additions & 0 deletions labs/1414080902224/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE HTML>
<html>
<head>
<title>发布笔记</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>
<script src="index.js" type="text/javascript"></script>
</head>
<body>
<form>
发表笔记:<br>
<textarea rows="10" cols="50"></textarea>
<button type="button" class="btn btn-default">发表</button>
</form>
</body>
</html>