Browse Source

ЙЙ

master
esoe 2 years ago
parent
commit
da0c63200e
  1. 18
      pom.xml
  2. 2
      src/main/webapp/WEB-INF/web.xml
  3. BIN
      target/classes/ru/molokoin/FileDownloadServlet.class
  4. BIN
      target/classes/ru/molokoin/FileUploadServlet.class
  5. BIN
      target/classes/ru/molokoin/UploadDetail.class
  6. BIN
      target/classes/ru/molokoin/UploadedFilesServlet.class
  7. BIN
      target/exchange-servlet.war
  8. BIN
      target/exchange-servlet/WEB-INF/classes/ru/molokoin/FileDownloadServlet.class
  9. BIN
      target/exchange-servlet/WEB-INF/classes/ru/molokoin/FileUploadServlet.class
  10. BIN
      target/exchange-servlet/WEB-INF/classes/ru/molokoin/UploadDetail.class
  11. BIN
      target/exchange-servlet/WEB-INF/classes/ru/molokoin/UploadedFilesServlet.class
  12. BIN
      target/exchange-servlet/WEB-INF/lib/javax.servlet-api-3.1.0.jar
  13. BIN
      target/exchange-servlet/WEB-INF/lib/jsp-api-2.1.jar
  14. 10
      target/exchange-servlet/WEB-INF/web.xml
  15. 42
      target/exchange-servlet/allfiles.jsp
  16. 28
      target/exchange-servlet/fileupload.jsp
  17. 37
      target/exchange-servlet/fileuploadResponse.jsp
  18. 73
      target/exchange-servlet/resource/css/main.css
  19. 4
      target/maven-archiver/pom.properties
  20. 4
      target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
  21. 4
      target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

18
pom.xml

@ -5,18 +5,18 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>ru.molokoin</groupId> <groupId>ru.molokoin</groupId>
<artifactId>exchange-servlet</artifactId> <artifactId>exchange-service</artifactId>
<version>0.1</version> <version>0.1</version>
<packaging>war</packaging> <packaging>war</packaging>
<name>exchange-servlet Maven Webapp</name> <name>exchange-service</name>
<!-- FIXME change it to the project's website --> <!-- FIXME change it to the project's website -->
<url>http://www.example.com</url> <url>http://www.molokoin.ru/exchange</url>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source> <maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target> <maven.compiler.target>11</maven.compiler.target>
</properties> </properties>
<dependencies> <dependencies>
@ -30,16 +30,10 @@
<artifactId>jsp-api</artifactId> <artifactId>jsp-api</artifactId>
<version>2.1</version> <version>2.1</version>
</dependency> </dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>exchange-servlet</finalName> <finalName>exchange-service</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --> <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins> <plugins>
<plugin> <plugin>

2
src/main/webapp/WEB-INF/web.xml

@ -3,7 +3,7 @@
"http://java.sun.com/dtd/web-app_2_3.dtd" > "http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app> <web-app>
<display-name>exchange-servlet</display-name> <display-name>exchange-service</display-name>
<welcome-file-list> <welcome-file-list>
<welcome-file>fileupload.jsp</welcome-file> <welcome-file>fileupload.jsp</welcome-file>
</welcome-file-list> </welcome-file-list>

BIN
target/classes/ru/molokoin/FileDownloadServlet.class

Binary file not shown.

BIN
target/classes/ru/molokoin/FileUploadServlet.class

Binary file not shown.

BIN
target/classes/ru/molokoin/UploadDetail.class

Binary file not shown.

BIN
target/classes/ru/molokoin/UploadedFilesServlet.class

Binary file not shown.

BIN
target/exchange-servlet.war

Binary file not shown.

BIN
target/exchange-servlet/WEB-INF/classes/ru/molokoin/FileDownloadServlet.class

Binary file not shown.

BIN
target/exchange-servlet/WEB-INF/classes/ru/molokoin/FileUploadServlet.class

Binary file not shown.

BIN
target/exchange-servlet/WEB-INF/classes/ru/molokoin/UploadDetail.class

Binary file not shown.

BIN
target/exchange-servlet/WEB-INF/classes/ru/molokoin/UploadedFilesServlet.class

Binary file not shown.

BIN
target/exchange-servlet/WEB-INF/lib/javax.servlet-api-3.1.0.jar

Binary file not shown.

BIN
target/exchange-servlet/WEB-INF/lib/jsp-api-2.1.jar

Binary file not shown.

10
target/exchange-servlet/WEB-INF/web.xml

@ -1,10 +0,0 @@
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>exchange-servlet</display-name>
<welcome-file-list>
<welcome-file>fileupload.jsp</welcome-file>
</welcome-file-list>
</web-app>

42
target/exchange-servlet/allfiles.jsp

@ -1,42 +0,0 @@
<%@page import="java.util.List"%>
<%@page import="ru.molokoin.UploadDetail"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>exchange-servlet</title>
<link rel="stylesheet" href="resource/css/main.css" />
</head>
<body>
<div class="panel">
<h1>Uploaded Files</h1>
<table class="bordered_table">
<thead>
<tr align="center"><th>File Name</th><th>File Size</th><th>Action</th></tr>
</thead>
<tbody>
<% List<UploadDetail> uploadDetails = (List<UploadDetail>)request.getAttribute("uploadedFiles");
if(uploadDetails != null && uploadDetails.size() > 0) {
for(int i=0; i<uploadDetails.size(); i++) {
%>
<tr>
<td align="center"><span id="fileName"><%=uploadDetails.get(i).getFileName() %></span></td>
<td align="center"><span id="fileSize"><%=uploadDetails.get(i).getFileSize() %> KB</span></td>
<td align="center"><span id="fileDownload"><a id="downloadLink" class="hyperLink" href="<%=request.getContextPath()%>/downloadServlet?fileName=<%=uploadDetails.get(i).getFileName() %>">Download</a></span></td>
</tr>
<% }
} else { %>
<tr>
<td colspan="3" align="center"><span id="noFiles">No Files Uploaded.....!</span></td>
</tr>
<% } %>
</tbody>
</table>
<div class="margin_top_15px">
<a id="fileUpload" class="hyperLink" href="<%=request.getContextPath()%>/fileupload.jsp">Back</a>
</div>
</div>
</body>
</html>

28
target/exchange-servlet/fileupload.jsp

@ -1,28 +0,0 @@
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>exchange-servlet</title>
<link rel="stylesheet" href="resource/css/main.css" />
</head>
<body>
<div class="panel">
<h1>File Upload</h1>
<h3>Press 'CTRL' Key+Click On File To Select Multiple Files in Open Dialog</h3>
<form id="fileUploadForm" method="post" action="fileUploadServlet" enctype="multipart/form-data">
<div class="form_group">
<label>Upload File</label><span id="colon">: </span><input id="fileAttachment" type="file" name="fileUpload" multiple="multiple" />
<span id="fileUploadErr">Please Upload A File!</span>
</div>
<button id="uploadBtn" type="submit" class="btn btn_primary">Upload</button>
</form>
</div>
<!-- List All Uploaded Files -->
<div class="panel">
<a id="allFiles" class="hyperLink" href="<%=request.getContextPath()%>/uploadedFilesServlet">List all uploaded files</a>
</div>
</body>
</html>

37
target/exchange-servlet/fileuploadResponse.jsp

@ -1,37 +0,0 @@
<%@page import="java.util.List"%>
<%@page import="ru.molokoin.UploadDetail"%>
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>exchange-servlet</title>
<link rel="stylesheet" href="resource/css/main.css" />
</head>
<body>
<div class="panel">
<h1>File Upload Status</h1>
<table class="bordered_table">
<thead>
<tr align="center"><th>File Name</th><th>File Size</th><th>Upload Status</th><th>Action</th></tr>
</thead>
<tbody>
<% List<UploadDetail> uploadDetails = (List<UploadDetail>)request.getAttribute("uploadedFiles");
for(int i=0; i<uploadDetails.size(); i++) {
%>
<tr>
<td align="center"><span id="fileName"><%=uploadDetails.get(i).getFileName() %></span></td>
<td align="center"><span id="fileSize"><%=uploadDetails.get(i).getFileSize() %> KB</span></td>
<td align="center"><span id="fileuploadStatus"><%=uploadDetails.get(i).getUploadStatus() %></span></td>
<td align="center"><span id="fileDownload"><a id="downloadLink" class="hyperLink" href="<%=request.getContextPath()%>/downloadServlet?fileName=<%=uploadDetails.get(i).getFileName() %>">Download</a></span></td>
</tr>
<% } %>
</tbody>
</table>
<div class="margin_top_15px">
<a id="fileUpload" class="hyperLink" href="<%=request.getContextPath()%>/fileupload.jsp">Back</a>
</div>
</div>
</body>
</html>

73
target/exchange-servlet/resource/css/main.css

@ -1,73 +0,0 @@
* {
box-sizing: border-box;
}
.margin_top_15px {
margin-top: 15px;
}
.panel {
display: block;
padding: 15px;
border: 1px solid #c0c0c0;
width: 849px;
margin: 52px 0px 0px 32px;
}
label {
display: inline-block;
margin-bottom: 5px;
}
.form_group {
margin: 10px;
}
.btn_primary {
color: #fff;
background-color: #0275d8;
border-color: #0275d8;
}
.btn {
display: inline-block;
padding: 10px;
text-align: center;
white-space: nowrap;
vertical-align: middle;
cursor: pointer;
border: 1px solid transparent;
}
.input_error {
color: #DE3330;
padding: 5px;
}
.bordered_table {
border-collapse: collapse;
width: 100%;
table-layout: fixed;
}
.bordered_table tr,th,td {
border: 1px solid #333;
}
.bordered_table th,td {
padding: 5px;
}
.bordered_table td {
word-wrap: break-word;
}
#noFiles {
color: red;
font-size: larger;
}
.hyperLink {
text-decoration: none;
cursor: pointer;
}

4
target/maven-archiver/pom.properties

@ -1,4 +0,0 @@
#Created by Apache Maven 3.8.5
groupId=ru.molokoin
artifactId=exchange-servlet
version=0.1

4
target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst

@ -1,4 +0,0 @@
ru\molokoin\FileUploadServlet.class
ru\molokoin\UploadDetail.class
ru\molokoin\FileDownloadServlet.class
ru\molokoin\UploadedFilesServlet.class

4
target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst

@ -1,4 +0,0 @@
c:\Users\Strannik\Documents\esoe\code\exchange-servlet\src\main\java\ru\molokoin\UploadDetail.java
c:\Users\Strannik\Documents\esoe\code\exchange-servlet\src\main\java\ru\molokoin\FileUploadServlet.java
c:\Users\Strannik\Documents\esoe\code\exchange-servlet\src\main\java\ru\molokoin\UploadedFilesServlet.java
c:\Users\Strannik\Documents\esoe\code\exchange-servlet\src\main\java\ru\molokoin\FileDownloadServlet.java
Loading…
Cancel
Save