forked from hzuapps/java-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
102 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
jweb/src/edu/hzu/javaweb/labs/se1414080902240/Se1414080902240Servlet.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,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); | ||
} | ||
|
||
} |
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,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> |