Skip to content

Commit

Permalink
hzuapps#4 提交实验代码
Browse files Browse the repository at this point in the history
  • Loading branch information
Yveemi committed Oct 27, 2016
1 parent 4931012 commit 068ace2
Show file tree
Hide file tree
Showing 2 changed files with 102 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package edu.hzu.javaweb.labs.se1414080902240;

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;

/**
* Servlet implementation class Se1414080902240Servlet
*/
@WebServlet("/Se1414080902240Servlet")
public class Se1414080902240Servlet extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
* @see HttpServlet#HttpServlet()
*/
public Se1414080902240Servlet() {
super();
// TODO Auto-generated constructor stub
}

/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
out.println("<ul><li>MUSIC 1</li><li>MUSIC 2</li><li>MUSIC 3</li></ul>");
}

/**
* @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub
doGet(request, response);
}

}
57 changes: 57 additions & 0 deletions jweb/web/1414080902240/index.jsp
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<!DOCTYPE html>


<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE-edge">
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css">
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script>

<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="index.js"></script>

<style>
#login_panel
{
width: 302px;
height: 200px;
top: 92px;
left:500px;
background-color: rgba(0,0,0,0.05);
position: relative;
border-radius: 5px;
border: 1px solid rgba(201,201,201,0.5);
float: none;
padding-left: 80px;
padding-right: 35px;
padding-top: 45px;
}
.uk-margin {
margin-bottom: 20px;
}
</style>

</head>
<body>
<div id="login_panel">
<form action="1414080902240" method="post" enctype="multipart/form-data">
<div class="uk-margin" style="text-align:?center;" >
<h3 style="color:red;">
分享你的音乐</h3>
</div>
<input type="file" name="music" />
</br>
<input type="submit" placeholder="上传" name="submit" value="上传" />
</form>
<a href='1414080902240'>歌曲列表</a>

</div>


</body></html>

0 comments on commit 068ace2

Please sign in to comment.