diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 62c8935..0000000 --- a/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.idea/ \ No newline at end of file diff --git a/201836900114_maintenance_story.txt b/201836900114_maintenance_story.txt new file mode 100644 index 0000000..a7650cb --- /dev/null +++ b/201836900114_maintenance_story.txt @@ -0,0 +1,11 @@ +GitHub link: +https://github.com/lanlab-org/OAPS-Jifry/tree/201836900114-zwq + +Group information: +201836900106 洪 仪 +201836900113 许璐怡 +201836900114 朱文琦 +201836900115 诸斯涔 + +concise maintenance story: +添加了在主页自动推送popular article的功能,由于最初版本的jifry项目没有管理员界面,所以我们直接为项目在主页顶端添加了自动显示点赞最高的两篇文章以实现文章推荐功能,用户就可以根据推荐去浏览想看的文章。 diff --git a/The things I have done.txt b/The things I have done.txt deleted file mode 100644 index a919318..0000000 --- a/The things I have done.txt +++ /dev/null @@ -1,7 +0,0 @@ -The things I have done (What I still remember): -0、Organize the messy resources, design and modify the database to make the project run; -1、The function of hiding or displaying the article is added; -2、The administrator can edit and add subject; -3、The problem of Chinese garbled code is solved; -4、The type and size of uploaded files are limited; -5、Fixed some bugs in the original project; \ No newline at end of file diff --git a/WZF_OAPS.iml b/WZF_OAPS.iml deleted file mode 100644 index 91a84fc..0000000 --- a/WZF_OAPS.iml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/webapp/Contact.jsp b/WebContent/Aboutus.jsp similarity index 75% rename from src/main/webapp/Contact.jsp rename to WebContent/Aboutus.jsp index 7064503..138e596 100644 --- a/src/main/webapp/Contact.jsp +++ b/WebContent/Aboutus.jsp @@ -1,10 +1,10 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> - -Contact + +About us @@ -88,13 +84,12 @@ footer
-

开发者邮箱:1614518467@qq.com

- \ No newline at end of file + diff --git a/target/WZF_OAPS/Author.jsp b/WebContent/Admin.jsp similarity index 78% rename from target/WZF_OAPS/Author.jsp rename to WebContent/Admin.jsp index 6d05f9a..bedb1f7 100644 --- a/target/WZF_OAPS/Author.jsp +++ b/WebContent/Admin.jsp @@ -1,12 +1,11 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - - + Admin @@ -36,7 +35,7 @@ header a margin-left:25px; text-decoration:none; color:white; - cursor:default; + cursor: } header a:hover @@ -127,13 +126,12 @@ footer
- + - + - - + +

Admin Login

register
register
-

${advice}

diff --git a/WebContent/AdminEdit.jsp b/WebContent/AdminEdit.jsp new file mode 100644 index 0000000..78fad60 --- /dev/null +++ b/WebContent/AdminEdit.jsp @@ -0,0 +1,134 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> + + + + +Insert title here + + + + + + + +
+

Welcome Admin

+ +
+ + + + + + select * from article where title='<%= request.getAttribute("title")%>' + + + + + +
+ +"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Current Subject
" readonly style="background:lightgray">
Title
" placeholder="Enter title" required>
Highlights
" placeholder="Enter highlights" required>
Abstract
" placeholder="Enter abstract" required>
+
+ +
+ + + + + \ No newline at end of file diff --git a/src/main/webapp/AuthorHome.jsp b/WebContent/AdminHome.jsp similarity index 60% rename from src/main/webapp/AuthorHome.jsp rename to WebContent/AdminHome.jsp index 060dd34..2c70215 100644 --- a/src/main/webapp/AuthorHome.jsp +++ b/WebContent/AdminHome.jsp @@ -1,124 +1,117 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> - - - - - -Author Home - - - - - - - - - select * from article a , subject s where a.sid=s.sid - -
-

Admin Article

- -
- - - -
- - - - - - - - - - - - - - - - - -
SubjectTitleHighlightHideOption
edit || - delete|| - show|| - hide -
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> + + + + + +Admin Home + + + + + + +
+

Welcome Admin

+ +
+ + + + +select * from article where author="${ email}" + + +
+ + + + + + + + + + + + + + + +
SubjectTitleHighlightOption
edit || + delete
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/target/WZF_OAPS/AuthorRegister.jsp b/WebContent/AdminRegister.jsp similarity index 80% rename from target/WZF_OAPS/AuthorRegister.jsp rename to WebContent/AdminRegister.jsp index 814a9f7..608652c 100644 --- a/target/WZF_OAPS/AuthorRegister.jsp +++ b/WebContent/AdminRegister.jsp @@ -1,179 +1,173 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - - - - - -Author Register - - - - - - -
- -
- - -
- - - - - - - - - - - -

Registration

email
password
confirm password
-
- - -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + + + + + +Author Register + + + + + + +
+ +
+ + +
+ + + + + + + + + + + +

Author Registration

email
password
confirm password
+
+ + +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/Articles.jsp b/WebContent/Articles.jsp similarity index 79% rename from src/main/webapp/Articles.jsp rename to WebContent/Articles.jsp index eeac7cd..e22f99f 100644 --- a/src/main/webapp/Articles.jsp +++ b/WebContent/Articles.jsp @@ -1,174 +1,173 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - -Articles - - - - - - -
- -
- - - - -select * from article a , subject s where a.sid=s.sid and hide="No" - - -
- - - - - - - - - - - - - - - -
TitleAuthorTimePopularity
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> + + + + +Articles + + + + + + +
+ +
+ + + + +select * from article + + +
+ + + + + + + + + + + + + + + +
TitleAuthorTimePopularity
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/AuthorArticle.jsp b/WebContent/AuthorArticle.jsp similarity index 80% rename from src/main/webapp/AuthorArticle.jsp rename to WebContent/AuthorArticle.jsp index 288ecd8..bb8a496 100644 --- a/src/main/webapp/AuthorArticle.jsp +++ b/WebContent/AuthorArticle.jsp @@ -1,179 +1,178 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - -Author Article - - - - - - -
- -
- - - - -select * from article a , subject s where a.sid=s.sid and author = '${ author}' - - -
- - - - - - - - - - - - - - - - - - -
AuthorSubjectTitleTimePopularity
Download
-
- - -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> + + + + + +Author Article + + + + + + +
+ +
+ + + + +select * from article where author = '${ author}' + + +
+ + + + + + + + + + + + + + + + + + +
AuthorSubjectTitleTimePopularity
Download
+
+ + +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/Comments.jsp b/WebContent/Comments.jsp similarity index 80% rename from src/main/webapp/Comments.jsp rename to WebContent/Comments.jsp index f53686a..1949efb 100644 --- a/src/main/webapp/Comments.jsp +++ b/WebContent/Comments.jsp @@ -1,177 +1,176 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - - -Comments - - - - - - -
- -
- - - - -select * from comments - - -
- - - - - - - - - - - - - - - -
TitleUserCommentTime
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> + + + + + +Comments + + + + + + +
+ +
+ + + + +select * from comments + + +
+ + + + + + + + + + + + + + + +
TitleUserCommentTime
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/target/WZF_OAPS/Contact.jsp b/WebContent/Contact.jsp similarity index 76% rename from target/WZF_OAPS/Contact.jsp rename to WebContent/Contact.jsp index 7064503..c126e4e 100644 --- a/target/WZF_OAPS/Contact.jsp +++ b/WebContent/Contact.jsp @@ -1,119 +1,113 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Contact - - - - - - -
- -
- - -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Contact + + + + + + +
+ +
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/WebContent/META-INF/MANIFEST.MF b/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/target/WZF_OAPS/Master.jsp b/WebContent/Master.jsp similarity index 59% rename from target/WZF_OAPS/Master.jsp rename to WebContent/Master.jsp index 8a9393a..ae9c6ce 100644 --- a/target/WZF_OAPS/Master.jsp +++ b/WebContent/Master.jsp @@ -1,64 +1,64 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Master Author - - - - - - - -
-

Welcome Author

- -
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Master Admin + + + + + + + +
+

Welcome Admin

+ +
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/MasterArticles.jsp b/WebContent/MasterArticles.jsp similarity index 63% rename from src/main/webapp/MasterArticles.jsp rename to WebContent/MasterArticles.jsp index f4cb794..85c0ad6 100644 --- a/src/main/webapp/MasterArticles.jsp +++ b/WebContent/MasterArticles.jsp @@ -1,125 +1,125 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - - -Master Articles - - - - - - - -
-

Welcome Author

- -
- - - - -select * from article a,subject s where a.sid=c.sid - - -
- - - - - - - - - - - - - - - -
TitleAuthorTimeOption
delete
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> + + + + + +Master Articles + + + + + + + +
+

Welcome Admin

+ +
+ + + + +select * from article + + +
+ + + + + + + + + + + + + + + +
TitleAuthorTimeOption
delete
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/target/WZF_OAPS/MasterAuthors.jsp b/WebContent/MasterAuthors.jsp similarity index 66% rename from target/WZF_OAPS/MasterAuthors.jsp rename to WebContent/MasterAuthors.jsp index 96b142e..57d4a21 100644 --- a/target/WZF_OAPS/MasterAuthors.jsp +++ b/WebContent/MasterAuthors.jsp @@ -1,123 +1,123 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - -Master Author - - - - - - - -
-

Welcome Author

- -
- - - - -select author from article where author not in (select email from block_author) - - -
- - - - - - - - - - - - -
AuthorOption
block
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> + + + + + +Master Author + + + + + + + +
+

Welcome Admin

+ +
+ + + + +select author from article where author not in (select email from block_author) + + +
+ + + + + + + + + + + + +
AuthorOption
block
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/MasterComments.jsp b/WebContent/MasterComments.jsp similarity index 62% rename from src/main/webapp/MasterComments.jsp rename to WebContent/MasterComments.jsp index 6351b7a..1982760 100644 --- a/src/main/webapp/MasterComments.jsp +++ b/WebContent/MasterComments.jsp @@ -1,64 +1,64 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Master Comments - - - - - - - -
-

Welcome Author

- -
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> + + + + +Master Comments + + + + + + + +
+

Welcome Admin

+ +
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/MasterViewArticle.jsp b/WebContent/MasterViewArticle.jsp similarity index 71% rename from src/main/webapp/MasterViewArticle.jsp rename to WebContent/MasterViewArticle.jsp index 39056a7..18902ce 100644 --- a/src/main/webapp/MasterViewArticle.jsp +++ b/WebContent/MasterViewArticle.jsp @@ -1,130 +1,130 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - - -Master View Article - - - - - - - -
-

Welcome Author

- -
- - - - -select * from article a , subject s where a.sid=s.sid and title="${ title}"; - - -
- - - - - - - - - - - - - - - - - -

Abstract
Highlight
Publication Date
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> + + + + + + +Master View Article + + + + + + + +
+

Welcome Admin

+ +
+ + + + +select * from article where title="${ title}"; + + +
+ + + + + + + + + + + + + + + + + +

Abstract
Highlight
Publication Date
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/NewFile.jsp b/WebContent/NewFile.jsp similarity index 73% rename from src/main/webapp/NewFile.jsp rename to WebContent/NewFile.jsp index 01e5dfc..ff98154 100644 --- a/src/main/webapp/NewFile.jsp +++ b/WebContent/NewFile.jsp @@ -1,221 +1,220 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - -NewFile - - - - - - -
- -
- -
- - - - - - -

You are in

-
- - - - -select * from article a , subject s where a.sid=s.sid and subject='<%=request.getAttribute("subject") %>' and hide="No" - - -
- - - - - - - - - - - - - - - - -
TitleAuthorTimePopularity
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> + + + + +NewFile + + + + + + +
+ +
+ +
+ + + + + + +

You are in

+
+ + + + +select * from article where subject='<%=request.getAttribute("subject") %>' + + +
+ + + + + + + + + + + + + + + + +
TitleAuthorTimePopularity
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/WebContent/NewFile1.jsp b/WebContent/NewFile1.jsp new file mode 100644 index 0000000..fe37d8b --- /dev/null +++ b/WebContent/NewFile1.jsp @@ -0,0 +1,238 @@ +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> + + + + + +Home + + + + + + +
+ +
+ + + + + +select title,SUM(prefer) AS popular FROM user_ip group BY title order by popular DESC LIMIT 0,2; + + + + + + + + + +select * from article where subject="Physical Science"; + + + +select * from article where subject="Computer Science"; + + + +select * from article where subject="Medical Science"; + + + +select * from article where subject="Social Science"; + + + +select * from article where subject="Biological Science"; + + + +select * from article where subject="Mathematics"; + + + +
+
+
+
+
+ + + + + + + + + + +
Recent Popular Article
+ +
+ +Physical Science + +
+
+ +Computer Science + + +
+
+ +Medical Science + +
+
+ + +Social Science + +
+
+ +Biological Science + +
+
+ +Mathematics + +
+
+
+
+
+
+
+ + + +

+ +
+2019 copyright©mjh.mohamed +
+ + + diff --git a/src/main/webapp/PostArticle.jsp b/WebContent/PostArticle.jsp similarity index 77% rename from src/main/webapp/PostArticle.jsp rename to WebContent/PostArticle.jsp index 1c14147..b96e06a 100644 --- a/src/main/webapp/PostArticle.jsp +++ b/WebContent/PostArticle.jsp @@ -1,192 +1,191 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - -Post Articles - - - - - - -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

${suggestion}

Author's email
" readonly style="background:lightgray">
Current Subject
" readonly style="background:lightgray">
Title
Highlights
Abstract
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + + + + +Post Articles + + + + + + +
+ +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Author
" readonly style="background:lightgray">
Current Subject
" readonly style="background:lightgray">
Title
Highlights
Abstract
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/Search.jsp b/WebContent/Search.jsp similarity index 78% rename from src/main/webapp/Search.jsp rename to WebContent/Search.jsp index fb5e49f..acc8067 100644 --- a/src/main/webapp/Search.jsp +++ b/WebContent/Search.jsp @@ -1,217 +1,216 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - - -Search - - - - - - -
- -
- - - - -select * from article a , subject s where a.sid=s.sid and hide="No" and (title like '%<%=request.getAttribute("search2") %>%' or abstracts like '%<%=request.getAttribute("search2") %>%' or highlight like '%<%=request.getAttribute("search2") %>%') order by time desc - - -
- - - - - - - - - - - - - - - - - - -
SubjectTitleAuthor EmailTimePopularity
-
- -

- - - -select * from comments where comment like '%<%=request.getAttribute("search2") %>%' order by time desc - - - -
- - - - - - - - - - - - - - - - - - - -
TitleCommentTimeAuthor
-
- - -
-Copyright (C) 2019, 2020 [MIJC Team] -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> + + + + + +Search + + + + + + +
+ +
+ + + + +select * from article where title like '%<%=request.getAttribute("search2") %>%' or abstracts like '%<%=request.getAttribute("search2") %>%' or highlight like '%<%=request.getAttribute("search2") %>%' order by time desc + + +
+ + + + + + + + + + + + + + + + + + +
SubjectTitleAuthorTimePopularity
+
+ +

+ + + +select * from comments where comment like '%<%=request.getAttribute("search2") %>%' order by time desc + + + +
+ + + + + + + + + + + + + + + + + + + +
Article TitleCommentTimeAuthor
+
+ + +
+Copyright (C) 2019, 2020 [MIJC Team] +
+ + \ No newline at end of file diff --git a/target/WZF_OAPS/ViewArticle.jsp b/WebContent/ViewArticle.jsp similarity index 82% rename from target/WZF_OAPS/ViewArticle.jsp rename to WebContent/ViewArticle.jsp index e6352a7..0d2eb19 100644 --- a/target/WZF_OAPS/ViewArticle.jsp +++ b/WebContent/ViewArticle.jsp @@ -1,420 +1,420 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - -View Article - - - - - - - -
- -
- - - - -select * from article a , subject s where a.sid=s.sid and title="${ title}"; - - -<%---------------------------------------------------------------------- --%> - - -select * from love_article where prefer=1 and title="${ title}"; - - - - - - - - -<%---------------------------------------------------------------------- --%> - - -select * from love_article where prefer=0 and title="${ title}"; - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -

Abstract
Highlight
Publication Date
Author
-
- - - - -
-
- - - - -
-Download -
-
- -
- -
- - - - - - - -
-
- -
- - -select * from comments where title="${ title}" - - -<%---------------------------------------------------------------------- --%> -<%-- This block is the comment box, where the comment, user, and time are - going to be displayed. - --%> - - -
- - - - - - - -

- - - - - -select * from love_comment where prefer=1 and cid="${ row.id}"; - - - - - - - - -
- - - - - -
- - - - - -select * from love_comment where prefer=0 and cid="${ row.id}"; - - - - - - - - - -
- - - - - -
- - - -
-
- -

- -
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> + + + + + +View Article + + + + + + + +
+ +
+ + + + +select * from article where title="${ title}"; + + +<%---------------------------------------------------------------------- --%> + + +select * from user_ip where prefer=1 and title="${ title}"; + + + + + + + + +<%---------------------------------------------------------------------- --%> + + +select * from user_ip where prefer=0 and title="${ title}"; + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +

Abstract
Highlight
Publication Date
Author
+
+ + + + +
+
+ + + + +
+Download +
+
+ +
+ +
+ + + + + + + + +
+
+ +
+ + +select * from comments where title="${ title}" + + +<%---------------------------------------------------------------------- --%> +<%-- This block is the comment box, where the comment, user, and time are + going to be displayed. + --%> + + +
+ + + + + + + +

+ + + + + +select * from comments_ip where prefer=1 and id="${ row.id}"; + + + + + + + + +
+ + + + + +
+ + + + + +select * from comments_ip where prefer=0 and id="${ row.id}"; + + + + + + + + + +
+ + + + + +
+ + + +
+
+ +

+ +
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/target/WZF_OAPS/WEB-INF/lib/commons-fileupload-1.3.jar b/WebContent/WEB-INF/lib/commons-fileupload-1.3.jar similarity index 100% rename from target/WZF_OAPS/WEB-INF/lib/commons-fileupload-1.3.jar rename to WebContent/WEB-INF/lib/commons-fileupload-1.3.jar diff --git a/target/WZF_OAPS/WEB-INF/lib/commons-io-2.4.jar b/WebContent/WEB-INF/lib/commons-io-2.4.jar similarity index 100% rename from target/WZF_OAPS/WEB-INF/lib/commons-io-2.4.jar rename to WebContent/WEB-INF/lib/commons-io-2.4.jar diff --git a/target/WZF_OAPS/WEB-INF/lib/jstl-1.2.jar b/WebContent/WEB-INF/lib/jstl-1.2.jar similarity index 100% rename from target/WZF_OAPS/WEB-INF/lib/jstl-1.2.jar rename to WebContent/WEB-INF/lib/jstl-1.2.jar diff --git a/WebContent/WEB-INF/lib/mysql-connector-java-8.0.19.jar b/WebContent/WEB-INF/lib/mysql-connector-java-8.0.19.jar new file mode 100644 index 0000000..7750517 Binary files /dev/null and b/WebContent/WEB-INF/lib/mysql-connector-java-8.0.19.jar differ diff --git a/src/main/webapp/blocklist.jsp b/WebContent/blocklist.jsp similarity index 66% rename from src/main/webapp/blocklist.jsp rename to WebContent/blocklist.jsp index 19fafd8..b2fe385 100644 --- a/src/main/webapp/blocklist.jsp +++ b/WebContent/blocklist.jsp @@ -1,123 +1,123 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - -Master Author - - - - - - - -
-

Block List

- -
- - - - -select email from block_author; - - -
- - - - - - - - - - - - -
AuthorOption
release
-
- -
-2020 copyright©Wu Zhongfu -
- - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> + + + + + +Master Author + + + + + + + +
+

Block List

+ +
+ + + + +select email from block_author; + + +
+ + + + + + + + + + + + +
AuthorOption
release
+
+ +
+2019 copyright©mjh.mohamed +
+ + \ No newline at end of file diff --git a/src/main/webapp/style.css b/WebContent/style.css similarity index 87% rename from src/main/webapp/style.css rename to WebContent/style.css index 4fb8481..b336bd4 100644 --- a/src/main/webapp/style.css +++ b/WebContent/style.css @@ -1,69 +1,69 @@ -@charset "UTF-8"; - -body -{ - margin:0px; -} - -header -{ - background-color:blue; - text-align:center; - height:70px; - margin-bottom:50px; -} - -header nav -{ - padding-top:20px; -} - -header a -{ - font-size:25px; - margin-left:25px; - text-decoration:none; - color:white; - cursor:default; -} - -header a:hover -{ - color:gold; -} - -header form -{ - display:inline-block; -} - -header select -{ - margin-left:25px; - font-size:25px; - border-radius:3px 3px 3px 3px; -} - -header button -{ - font-size:20px; - border-radius:5px 5px 5px 5px; -} - -header input -{ - margin-left:25px; - font-size:20px; - border-radius:3px 3px 3px 3px; -} - -footer -{ - background:black; - height:40px; - color:white; - text-align:center; - padding:5px; - font-size:20px; - margin-top:50px; -} +@charset "ISO-8859-1"; + +body +{ + margin:0px; +} + +header +{ + background-color:blue; + text-align:center; + height:70px; + margin-bottom:50px; +} + +header nav +{ + padding-top:20px; +} + +header a +{ + font-size:25px; + margin-left:25px; + text-decoration:none; + color:white; + cursor: +} + +header a:hover +{ + color:gold; +} + +header form +{ + display:inline-block; +} + +header select +{ + margin-left:25px; + font-size:25px; + border-radius:3px 3px 3px 3px; +} + +header button +{ + font-size:20px; + border-radius:5px 5px 5px 5px; +} + +header input +{ + margin-left:25px; + font-size:20px; + border-radius:3px 3px 3px 3px; +} + +footer +{ + background:black; + height:40px; + color:white; + text-align:center; + padding:5px; + font-size:20px; + margin-top:50px; +} diff --git a/target/WZF_OAPS/success.jsp b/WebContent/success.jsp similarity index 69% rename from target/WZF_OAPS/success.jsp rename to WebContent/success.jsp index 8cd981d..66aaa74 100644 --- a/target/WZF_OAPS/success.jsp +++ b/WebContent/success.jsp @@ -1,24 +1,24 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -Insert title here - - - - - - - - - - - -">download -<%--">list--%> - - +<%@ page language="java" contentType="text/html; charset=ISO-8859-1" + pageEncoding="ISO-8859-1"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +Insert title here + + + + + + + + + + + +">download +">list + + \ No newline at end of file diff --git a/WebContent/web.xml b/WebContent/web.xml new file mode 100644 index 0000000..7d06599 --- /dev/null +++ b/WebContent/web.xml @@ -0,0 +1,44 @@ + + + OAPS + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + + user + com.javaBeans.Controller + + + user + /user + + + admin + com.javaBeans.AdminController + + + admin + /admin + + + up + com.javaBeans.UploadServlet + + + up + /up + + + down + com.javaBeans.DownloadServlet + + + down + /down + + \ No newline at end of file diff --git a/build/classes/com/database/DB.class b/build/classes/com/database/DB.class new file mode 100644 index 0000000..8eb0f28 Binary files /dev/null and b/build/classes/com/database/DB.class differ diff --git a/build/classes/com/javaBean/Article.class b/build/classes/com/javaBean/Article.class new file mode 100644 index 0000000..e471b10 Binary files /dev/null and b/build/classes/com/javaBean/Article.class differ diff --git a/build/classes/com/javaBean/Author.class b/build/classes/com/javaBean/Author.class new file mode 100644 index 0000000..0309dc7 Binary files /dev/null and b/build/classes/com/javaBean/Author.class differ diff --git a/build/classes/com/javaBeans/AdminController.class b/build/classes/com/javaBeans/AdminController.class new file mode 100644 index 0000000..b2b51de Binary files /dev/null and b/build/classes/com/javaBeans/AdminController.class differ diff --git a/build/classes/com/javaBeans/Controller.class b/build/classes/com/javaBeans/Controller.class new file mode 100644 index 0000000..a3fb482 Binary files /dev/null and b/build/classes/com/javaBeans/Controller.class differ diff --git a/build/classes/com/javaBeans/DownloadServlet.class b/build/classes/com/javaBeans/DownloadServlet.class new file mode 100644 index 0000000..2fabd02 Binary files /dev/null and b/build/classes/com/javaBeans/DownloadServlet.class differ diff --git a/build/classes/com/javaBeans/UploadServlet.class b/build/classes/com/javaBeans/UploadServlet.class new file mode 100644 index 0000000..fab0362 Binary files /dev/null and b/build/classes/com/javaBeans/UploadServlet.class differ diff --git a/db.sql b/db.sql deleted file mode 100644 index 49dfac2..0000000 --- a/db.sql +++ /dev/null @@ -1,126 +0,0 @@ -/* - -. -Navicat MySQL Data Transfer - -Source Server : yun -Source Server Version : 50730 -Source Host : 47.115.56.157:3306 -Source Database : oo - -Target Server Type : MYSQL -Target Server Version : 50730 -File Encoding : 65001 - -Date: 2020-11-04 12:59:31 -*/ - -SET FOREIGN_KEY_CHECKS=0; - --- ---------------------------- --- Table structure for administrator --- ---------------------------- -DROP TABLE IF EXISTS `administrator`; -CREATE TABLE `administrator` ( - `email` varchar(20) DEFAULT NULL, - `password` varchar(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- ---------------------------- --- Table structure for article --- ---------------------------- -DROP TABLE IF EXISTS `article`; -CREATE TABLE `article` ( - `aid` int(11) NOT NULL AUTO_INCREMENT, - `sid` int(11) DEFAULT NULL, - `title` varchar(100) CHARACTER SET utf8 DEFAULT NULL, - `highlight` varchar(250) CHARACTER SET utf8 DEFAULT NULL, - `abstracts` varchar(999) CHARACTER SET utf8 DEFAULT NULL, - `author` varchar(20) CHARACTER SET utf8 DEFAULT NULL, - `time` timestamp NULL DEFAULT NULL, - `filename` varchar(80) CHARACTER SET utf8 DEFAULT NULL, - `path` varchar(100) CHARACTER SET utf8 DEFAULT NULL, - `hide` varchar(10) CHARACTER SET utf8 DEFAULT NULL, - `ip` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - PRIMARY KEY (`aid`) -) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4; - --- ---------------------------- --- Table structure for author --- ---------------------------- -DROP TABLE IF EXISTS `author`; -CREATE TABLE `author` ( - `email` varchar(20) DEFAULT NULL, - `password` varchar(20) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- ---------------------------- --- Table structure for block_author --- ---------------------------- -DROP TABLE IF EXISTS `block_author`; -CREATE TABLE `block_author` ( - `id` int(11) NOT NULL, - `email` varchar(20) NOT NULL, - `ip` varchar(30) CHARACTER SET utf8 COLLATE utf8_german2_ci DEFAULT NULL, - `blockuntil` datetime DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- ---------------------------- --- Table structure for comments --- ---------------------------- -DROP TABLE IF EXISTS `comments`; -CREATE TABLE `comments` ( - `id` int(11) NOT NULL AUTO_INCREMENT, - `title` varchar(30) DEFAULT NULL, - `comment` varchar(50) DEFAULT NULL, - `time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, - `user` varchar(20) DEFAULT NULL, - `hide` varchar(10) CHARACTER SET utf8 DEFAULT NULL, - `ip` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - PRIMARY KEY (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8mb4; - --- ---------------------------- --- Table structure for love_article --- ---------------------------- -DROP TABLE IF EXISTS `love_article`; -CREATE TABLE `love_article` ( - `ip` varchar(20) DEFAULT NULL, - `title` varchar(30) DEFAULT NULL, - `prefer` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- ---------------------------- --- Table structure for love_comment --- ---------------------------- -DROP TABLE IF EXISTS `love_comment`; -CREATE TABLE `love_comment` ( - `ip` varchar(20) DEFAULT NULL, - `cid` int(11) NOT NULL, - `prefer` int(11) DEFAULT NULL -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; - --- ---------------------------- --- Table structure for subject --- ---------------------------- -DROP TABLE IF EXISTS `subject`; -CREATE TABLE `subject` ( - `sid` int(11) NOT NULL AUTO_INCREMENT, - `subject` varchar(30) CHARACTER SET utf8 DEFAULT NULL, - `sdate` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP, - `parentsid` int(11) DEFAULT NULL, - PRIMARY KEY (`sid`) -) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4; - --- ---------------------------- --- Table structure for visit --- ---------------------------- -DROP TABLE IF EXISTS `visit`; -CREATE TABLE `visit` ( - `vid` int(11) NOT NULL AUTO_INCREMENT, - `aid` int(11) DEFAULT NULL, - `ip` varchar(30) DEFAULT NULL, - `date` datetime DEFAULT NULL, - PRIMARY KEY (`vid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; diff --git a/lib/javax.annotation.jar b/lib/javax.annotation.jar deleted file mode 100644 index 52dca7f..0000000 Binary files a/lib/javax.annotation.jar and /dev/null differ diff --git a/lib/javax.ejb.jar b/lib/javax.ejb.jar deleted file mode 100644 index 4ebf5ec..0000000 Binary files a/lib/javax.ejb.jar and /dev/null differ diff --git a/lib/javax.jms.jar b/lib/javax.jms.jar deleted file mode 100644 index d31451a..0000000 Binary files a/lib/javax.jms.jar and /dev/null differ diff --git a/lib/javax.persistence.jar b/lib/javax.persistence.jar deleted file mode 100644 index 21d80e0..0000000 Binary files a/lib/javax.persistence.jar and /dev/null differ diff --git a/lib/javax.resource.jar b/lib/javax.resource.jar deleted file mode 100644 index 696a234..0000000 Binary files a/lib/javax.resource.jar and /dev/null differ diff --git a/lib/javax.servlet.jar b/lib/javax.servlet.jar deleted file mode 100644 index 0519e4a..0000000 Binary files a/lib/javax.servlet.jar and /dev/null differ diff --git a/lib/javax.servlet.jsp.jar b/lib/javax.servlet.jsp.jar deleted file mode 100644 index 9c0631c..0000000 Binary files a/lib/javax.servlet.jsp.jar and /dev/null differ diff --git a/lib/javax.transaction.jar b/lib/javax.transaction.jar deleted file mode 100644 index 729c695..0000000 Binary files a/lib/javax.transaction.jar and /dev/null differ diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 2bca6e9..0000000 --- a/pom.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - 4.0.0 - - zjnu - WZF_OAPS - 1.0-SNAPSHOT - war - - WZF_OAPS Maven Webapp - - http://www.example.com - - - UTF-8 - 1.7 - 1.7 - - - - - commons-fileupload - commons-fileupload - 1.3 - - - org.springframework - spring-context - 5.0.5.RELEASE - - - org.springframework - spring-web - 5.0.5.RELEASE - - - jstl - jstl - 1.2 - - - mysql - mysql-connector-java - 5.1.32 - - - commons-io - commons-io - 2.4 - - - - junit - junit - 4.11 - test - - - javax.servlet - javax.servlet-api - 3.1.0 - - - - - WZF_OAPS - - - - maven-clean-plugin - 3.1.0 - - - - maven-resources-plugin - 3.0.2 - - - maven-compiler-plugin - 3.8.0 - - - maven-surefire-plugin - 2.22.1 - - - maven-war-plugin - 3.2.2 - - - maven-install-plugin - 2.5.2 - - - maven-deploy-plugin - 2.8.2 - - - - - diff --git a/src/main/java/com/database/DB.java b/src/com/database/DB.java similarity index 52% rename from src/main/java/com/database/DB.java rename to src/com/database/DB.java index 8094371..c5d0e41 100644 --- a/src/main/java/com/database/DB.java +++ b/src/com/database/DB.java @@ -1,468 +1,328 @@ -package com.database; - -import com.javaBean.Administrator; -import com.javaBean.Article; -import com.javaBean.Author; -import com.javaBean.Subject; - -import java.sql.*; - -public class DB { - - public String root = "wzf"; - public String url = "jdbc:mysql://47.115.56.157:3306/oo?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8"; - public String password = "wzf"; - public String Driver = "com.mysql.jdbc.Driver"; - public Connection con; - - public void connect() throws SQLException - { - try - { - Class.forName(Driver); - - con = DriverManager.getConnection(url, root, password); - - } - - catch(ClassNotFoundException e) - { - e.printStackTrace(); - } - - } - - public void close() throws SQLException - { - con.close(); - } - - public void updateArticle(Article a) throws SQLException - { - connect(); - - String sql = "update article set title=?, highlight=?, abstracts=?, time=? where title=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, a.getTitle()); - ps.setString(2, a.getHighlights()); - ps.setString(3, a.getAbstracts()); - ps.setTimestamp(4, a.getTime()); - ps.setString(5, a.getOldtitle()); - ps.executeUpdate(); - - close(); - } - public void updateSubject(Subject s) throws SQLException - { - connect(); - - String sql = "update subject set subject=?, sdate=? where subject=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, s.getSubject()); - ps.setTimestamp(2,s.sdate); - ps.setString(3, s.getOldsubject()); - - ps.executeUpdate(); - - close(); - } - public void showArticle(String title) throws SQLException - { - connect(); - String sql="update article set hide=? where title=?"; - PreparedStatement ps = con.prepareStatement(sql); - ps.setString(1,"No"); - ps.setString(2,title); - ps.executeUpdate(); - close(); - - - - } - public void hideArticle(String title) throws SQLException - { - connect(); - String sql="update article set hide=? where title=?"; - PreparedStatement ps = con.prepareStatement(sql); - ps.setString(1,"Yes"); - ps.setString(2,title); - ps.executeUpdate(); - close(); - - - - } - - public void deleteArticle(String title) throws SQLException - { - connect(); - - String sql = "delete from article where title=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, title); - ps.executeUpdate(); - - close(); - - } - public void deleteSubject(int sid) throws SQLException - { - connect(); - - String sql = "delete from subject where sid=? or parentsid=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setInt(1, sid); - ps.setInt(2, sid); - ps.executeUpdate(); - - close(); - - } - - - public void deleteComment(String comment) throws SQLException - { - connect(); - - String sql = "delete from comments where comment=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, comment); - ps.executeUpdate(); - - close(); - - } - - public void addAuthor(Author a) throws SQLException - { - connect(); - - String sql = "insert into author(email,password) values(?,?)"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, a.getEmail()); - ps.setString(2, a.getPassword()); - ps.executeUpdate(); - - close(); - - } - public void addSubject(Subject a) throws SQLException - { - connect(); - - String sql = "insert into subject(sid,subject,sdate,parentsid) values(?,?,?,?)"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setInt(1,0); - ps.setString(2, a.getSubject()); - ps.setTimestamp(3, a.getSdate()); - int parentsid=0; - if (a.parentsid!=0) - { - parentsid=a.getParentsid(); - - - } - ps.setInt(4,parentsid); - ps.executeUpdate(); - - close(); - - } - - public boolean checkAuthor(Author a) throws SQLException - { - connect(); - - boolean result = false; - int i = 0; - - String sql = "select * from author where email=? and password=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, a.getEmail()); - ps.setString(2, a.getPassword()); - - ResultSet rs = ps.executeQuery(); - - while(rs.next()) - { - i = 1; - result= true; - } - - close(); - - return result; - } - public boolean checkAdministrator(Administrator a) throws SQLException - { - connect(); - - boolean result = false; - int i = 0; - - String sql = "select * from administrator where email=? and password=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, a.getEmail()); - ps.setString(2, a.getPassword()); - - ResultSet rs = ps.executeQuery(); - - if(rs.next()) - { - - result= true; - } - - close(); - - return result; - } - - public boolean checkblockauthor(String email) throws SQLException - { - connect(); - - boolean result = false; - int i = 0; - - - String sql = "select * from block_author where email=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, email); - - - ResultSet rs = ps.executeQuery(); - - while(rs.next()) - { - i = 1; - result= true; - } - - close(); - - return result; - } - - public void blockAuthor(String author) throws SQLException - { - connect(); - - String sql = "insert into block_author(email) values(?)"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, author); - ps.executeUpdate(); - - close(); - - } - - public void releaseAuthor(String author) throws SQLException - { - connect(); - - String sql = "delete from block_author where email=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, author); - ps.executeUpdate(); - - close(); - - } - - - public boolean checktitle(String title) throws SQLException - { - connect(); - - boolean result = false; - int i = 0; - - String sql = "select * from article a , subject s where a.sid=s.sid and title=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, title); - - - ResultSet rs = ps.executeQuery(); - - while(rs.next()) - { - i = 1; - result= true; - break; - } - - close(); - - return result; - } - public boolean checksubject(String subject) throws SQLException - { - connect(); - - boolean result = false; -// int i = 0; - - String sql = "select * from subject where subject=?"; - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, subject); - - - ResultSet rs = ps.executeQuery(); - - while(rs.next()) - { -// i = 1; - result= true; - break; - } - - close(); - - return result; - } - - - - // public boolean check_popular(String ip, String title, int a) throws SQLException -// { - public void check_popular(String ip, String title, int a) throws SQLException - { - connect(); - -// boolean result = false; - int i = 0; - - - - String sql = "insert into love_article(ip, title, prefer) values(?, ?, ?)"; - String sql2 = "select * from love_article where ip=? and title=?"; - String sql3 = "update love_article set prefer=? where ip=? and title=?"; - - PreparedStatement ps2 = con.prepareStatement(sql2); - ps2.setString(1, ip); - ps2.setString(2, title); - - ResultSet rs = ps2.executeQuery(); - - while(rs.next()) - { - i = 1; - } - - if(i==1) - { - PreparedStatement ps3 = con.prepareStatement(sql3); - ps3.setInt(1, a); - ps3.setString(2, ip); - ps3.setString(3, title); - ps3.executeUpdate(); -// result = false; - } - - else if(i==0) - { - PreparedStatement ps = con.prepareStatement(sql); - ps.setString(1, ip); - ps.setString(2, title); - ps.setInt(3, a); - ps.executeUpdate(); -// result = true; - } - - - close(); - -// return result; - } - - /* - - This function checks whether the user with the specific 'ip', has liked/disliked the comment - with the specific 'id'. - 'a' is a flag to determine whether the required operation is like or dislike, where a = 0, if - the required operation is dislike, and a = 1 if it's like. - - */ -// public boolean check_comments_popular(String ip, int id, int a) throws SQLException -// { - public void check_comments_popular(String ip, int id, int a) throws SQLException - { - connect(); - -// boolean result = false; - int i = 0; - - - - String sql = "insert into love_comment(ip, cid, prefer) values(?, ?, ?)"; - String sql2 = "select * from love_comment where ip=? and cid=?"; - String sql3 = "update love_comment set prefer=? where ip=? and cid=?"; - - PreparedStatement ps2 = con.prepareStatement(sql2); - ps2.setString(1, ip); - ps2.setInt(2, id); - - ResultSet rs = ps2.executeQuery(); - - if(rs.next()) - { - i = 1; - } - - if(i==1) - { - PreparedStatement ps3 = con.prepareStatement(sql3); - ps3.setInt(1, a); - ps3.setString(2, ip); - ps3.setInt(3, id); - ps3.executeUpdate(); -// result = false; - } - - else if(i==0) - { - PreparedStatement ps = con.prepareStatement(sql); - ps.setString(1, ip); - ps.setInt(2, id); - ps.setInt(3, a); - ps.executeUpdate(); -// result = true; - } - - - close(); - -// return result; - } - - -} +package com.database; + +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import com.javaBean.Article; +import com.javaBean.Author; + +public class DB { + + public String root = "root"; + public String url="jdbc:mysql://localhost:3306/ooad?serverTimezone=UTC&&autoReconnect=true&&useSSL=false"; + public String password = "1234"; + public String Driver = "com.mysql.cj.jdbc.Driver"; + public Connection con; + + public void connect() throws SQLException + { + try + { + Class.forName(Driver); + + con = DriverManager.getConnection(url, root, password); + + } + + catch(ClassNotFoundException e) + { + e.printStackTrace(); + } + + } + + public void close() throws SQLException + { + con.close(); + } + + public void updateArticle(Article a) throws SQLException + { + connect(); + + String sql = "update article set title=?, highlight=?, abstracts=?, time=? where title=?"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, a.getTitle()); + ps.setString(2, a.getHighlights()); + ps.setString(3, a.getAbstracts()); + ps.setTimestamp(4, a.getTime()); + ps.setString(5, a.getOldtitle()); + ps.executeUpdate(); + + close(); + } + + public void deleteArticle(String title) throws SQLException + { + connect(); + + String sql = "delete from article where title=?"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, title); + ps.executeUpdate(); + + close(); + + } + + public void deleteComment(String comment) throws SQLException + { + connect(); + + String sql = "delete from comments where comment=?"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, comment); + ps.executeUpdate(); + + close(); + + } + + public void addAuthor(Author a) throws SQLException + { + connect(); + + String sql = "insert into author(email,password) values(?,?)"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, a.getEmail()); + ps.setString(2, a.getPassword()); + ps.executeUpdate(); + + close(); + + } + + public boolean checkAuthor(Author a) throws SQLException + { + connect(); + + boolean result = false; + int i = 0; + + String sql = "select * from author where email=? and password=?"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, a.getEmail()); + ps.setString(2, a.getPassword()); + + ResultSet rs = ps.executeQuery(); + + while(rs.next()) + { + i = 1; + result= true; + } + + close(); + + return result; + } + + public boolean checkblockauthor(String email) throws SQLException + { + connect(); + + boolean result = false; + int i = 0; + + String sql = "select * from block_author where email=?"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, email); + + + ResultSet rs = ps.executeQuery(); + + while(rs.next()) + { + i = 1; + result= true; + } + + close(); + + return result; + } + + public void blockAuthor(String author) throws SQLException + { + connect(); + + String sql = "insert into block_author(email) values(?)"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, author); + ps.executeUpdate(); + + close(); + + } + + public void releaseAuthor(String author) throws SQLException + { + connect(); + + String sql = "delete from block_author where email=?"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, author); + ps.executeUpdate(); + + close(); + + } + + + public boolean checktitle(String title) throws SQLException + { + connect(); + + boolean result = false; + int i = 0; + + String sql = "select * from article where title=?"; + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, title); + + + ResultSet rs = ps.executeQuery(); + + while(rs.next()) + { + i = 1; + result= true; + } + + close(); + + return result; + } + + + public boolean check_popular(String ip, String title, int a) throws SQLException + { + connect(); + + boolean result = false; + int i = 0; + + + + String sql = "insert into user_ip(ip, title, prefer) values(?, ?, ?)"; + String sql2 = "select * from user_ip where ip=? and title=?"; + String sql3 = "update user_ip set prefer=? where ip=? and title=?"; + + PreparedStatement ps2 = con.prepareStatement(sql2); + ps2.setString(1, ip); + ps2.setString(2, title); + + ResultSet rs = ps2.executeQuery(); + + while(rs.next()) + { + i = 1; + } + + if(i==1) + { + PreparedStatement ps3 = con.prepareStatement(sql3); + ps3.setInt(1, a); + ps3.setString(2, ip); + ps3.setString(3, title); + ps3.executeUpdate(); + result = true; + } + + else if(i==0) + { + PreparedStatement ps = con.prepareStatement(sql); + ps.setString(1, ip); + ps.setString(2, title); + ps.setInt(3, a); + ps.executeUpdate(); + result = true; + } + + + close(); + + return result; + } + + /* + + This function checks whether the user with the specific 'ip', has liked/disliked the comment + with the specific 'id'. + 'a' is a flag to determine whether the required operation is like or dislike, where a = 0, if + the required operation is dislike, and a = 1 if it's like. + + */ + public boolean check_comments_popular(String ip, int id, int a) throws SQLException + { + connect(); + + boolean result = false; + int i = 0; + + + + String sql = "insert into comments_ip(ip, id, prefer) values(?, ?, ?)"; + String sql2 = "select * from comments_ip where ip=? and id=?"; + String sql3 = "update comments_ip set prefer=? where ip=? and id=?"; + + PreparedStatement ps2 = con.prepareStatement(sql2); + ps2.setString(1, ip); + ps2.setInt(2, id); + + ResultSet rs = ps2.executeQuery(); + + while(rs.next()) + { + i = 1; + } + + if(i==1) + { + PreparedStatement ps3 = con.prepareStatement(sql3); + ps3.setInt(1, a); + ps3.setString(2, ip); + ps3.setInt(3, id); + ps3.executeUpdate(); + result = true; + } + + else if(i==0) + { + PreparedStatement ps = con.prepareStatement(sql); + ps.setString(1, ip); + ps.setInt(2, id); + ps.setInt(3, a); + ps.executeUpdate(); + result = true; + } + + + close(); + + return result; + } + + +} diff --git a/src/main/java/com/javaBean/Article.java b/src/com/javaBean/Article.java similarity index 94% rename from src/main/java/com/javaBean/Article.java rename to src/com/javaBean/Article.java index 1e2710d..82f7776 100644 --- a/src/main/java/com/javaBean/Article.java +++ b/src/com/javaBean/Article.java @@ -1,69 +1,69 @@ -package com.javaBean; - -import java.sql.Timestamp; - -public class Article { - - public String subject, title, author, highlights, abstracts, oldtitle; - public String comment, user; - public Timestamp time; - - - public String getSubject() { - return subject; - } - public void setSubject(String subject) { - this.subject = subject; - } - public String getTitle() { - return title; - } - public void setTitle(String title) { - this.title = title; - } - public String getAuthor() { - return author; - } - public void setAuthor(String author) { - this.author = author; - } - public String getHighlights() { - return highlights; - } - public void setHighlights(String highlights) { - this.highlights = highlights; - } - public String getAbstracts() { - return abstracts; - } - public void setAbstracts(String abstracts) { - this.abstracts = abstracts; - } - public Timestamp getTime() { - return time; - } - public void setTime(Timestamp time) { - this.time = time; - } - public String getComment() { - return comment; - } - public void setComment(String comment) { - this.comment = comment; - } - public String getUser() { - return user; - } - public void setUser(String user) { - this.user = user; - } - public String getOldtitle() { - return oldtitle; - } - public void setOldtitle(String oldtitle) { - this.oldtitle = oldtitle; - } - - - -} +package com.javaBean; + +import java.sql.Timestamp; + +public class Article { + + public String subject, title, author, highlights, abstracts, oldtitle; + public String comment, user; + public Timestamp time; + + + public String getSubject() { + return subject; + } + public void setSubject(String subject) { + this.subject = subject; + } + public String getTitle() { + return title; + } + public void setTitle(String title) { + this.title = title; + } + public String getAuthor() { + return author; + } + public void setAuthor(String author) { + this.author = author; + } + public String getHighlights() { + return highlights; + } + public void setHighlights(String highlights) { + this.highlights = highlights; + } + public String getAbstracts() { + return abstracts; + } + public void setAbstracts(String abstracts) { + this.abstracts = abstracts; + } + public Timestamp getTime() { + return time; + } + public void setTime(Timestamp time) { + this.time = time; + } + public String getComment() { + return comment; + } + public void setComment(String comment) { + this.comment = comment; + } + public String getUser() { + return user; + } + public void setUser(String user) { + this.user = user; + } + public String getOldtitle() { + return oldtitle; + } + public void setOldtitle(String oldtitle) { + this.oldtitle = oldtitle; + } + + + +} diff --git a/src/main/java/com/javaBean/Author.java b/src/com/javaBean/Author.java similarity index 92% rename from src/main/java/com/javaBean/Author.java rename to src/com/javaBean/Author.java index ed1028b..5661b67 100644 --- a/src/main/java/com/javaBean/Author.java +++ b/src/com/javaBean/Author.java @@ -1,23 +1,24 @@ -package com.javaBean; -public class Author { - - public String email, password; - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - -} +package com.javaBean; + +public class Author { + + public String email, password; + + public String getEmail() { + return email; + } + + public void setEmail(String email) { + this.email = email; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + +} diff --git a/src/main/java/com/javaBeans/AuthorController.java b/src/com/javaBeans/AdminController.java similarity index 68% rename from src/main/java/com/javaBeans/AuthorController.java rename to src/com/javaBeans/AdminController.java index b54ecc1..820cdd6 100644 --- a/src/main/java/com/javaBeans/AuthorController.java +++ b/src/com/javaBeans/AdminController.java @@ -1,399 +1,373 @@ -package com.javaBeans; - -import java.io.IOException; -import java.sql.SQLException; -import java.sql.Timestamp; -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.swing.JOptionPane; -import com.database.DB; -import com.javaBean.Administrator; -import com.javaBean.Article; -import com.javaBean.Author; - -/** - * Servlet implementation class com.javaBeans.AuthorController - */ -@WebServlet("/com.javaBeans.AuthorController") -public class AuthorController extends HttpServlet { - HttpSession session; - private static final long serialVersionUID = 1L; - - /** - * @see HttpServlet#HttpServlet() - */ - public AuthorController() { - super(); - // TODO Auto-generated constructor stub - } - - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - String page = request.getParameter("page"); - - if(page == null) - { - request.getRequestDispatcher("AuthorHome.jsp").forward(request, response); - } - - else - { - doPost(request, response); - } - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - String page = request.getParameter("page"); - HttpSession session=request.getSession(); - - if(page.equals("admin")) - { - String email = request.getParameter("email"); - String password = request.getParameter("password"); - session.setAttribute("email",email); - Administrator a = new Administrator(); - a.setEmail(email); - a.setPassword(password); - - DB db = new DB(); - boolean status = false; - - try - { - status = db.checkAdministrator(a); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - if(status) - { - - -// request.setAttribute("email",email); - request.getRequestDispatcher("AuthorHome.jsp").forward(request, response); - } - - else - { - request.setAttribute("msg", "invalid"); - request.getRequestDispatcher("Author.jsp").forward(request, response); - } - } - - if(page.equals("register")) - { - request.getRequestDispatcher("AuthorRegister.jsp").forward(request, response); - } - - if(page.equals("register-form")) - { - String email = request.getParameter("email"); - String password = request.getParameter("password"); - String conpassword = request.getParameter("conpassword"); - - if(password.equals(conpassword)) - { - Author a = new Author(); - a.setEmail(email); - a.setPassword(password); - - DB db = new DB(); - - try - { - db.addAuthor(a); - session.setAttribute("email",email); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - request.getRequestDispatcher("Author.jsp").forward(request, response); - } - - else - { - request.getRequestDispatcher("AuthorRegister.jsp").forward(request, response); - } - } - - if(page.equals("home")) - { - String email = request.getParameter("email"); - request.setAttribute("email",email); - request.getRequestDispatcher("AuthorHome.jsp").forward(request, response); - } - - if(page.equals("logout")) - { - session.setAttribute("email",null); - request.getRequestDispatcher("Author.jsp").forward(request, response); - } - - if(page.equals("edit")) - { - String title = request.getParameter("title"); - String email = request.getParameter("email"); - - request.setAttribute("title", title); - request.setAttribute("email", email); - request.getRequestDispatcher("AuthorEdit.jsp").forward(request, response); - } - if (page.equals("hide")) - { - String title = request.getParameter("title"); - DB db = new DB(); - try { - db.hideArticle(title); - } catch (SQLException e) { - e.printStackTrace(); - } - request.getRequestDispatcher("AuthorHome.jsp").forward(request, response); - } - if (page.equals("show")) - { - String title = request.getParameter("title"); - DB db = new DB(); - try { - db.showArticle(title); - } catch (SQLException e) { - e.printStackTrace(); - } - request.getRequestDispatcher("AuthorHome.jsp").forward(request, response); - } - - if(page.equals("edit-form")) - { - String oldtitle = request.getParameter("old-title"); - - String title = request.getParameter("title"); - String highlights = request.getParameter("highlights"); - String abstracts = request.getParameter("abstracts"); - Timestamp time = new Timestamp(System.currentTimeMillis()); - - - DB db = new DB(); -/* boolean checkstatus = false; - - try - { - checkstatus = db.checktitle(title); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - if(checkstatus) - { - //JOptionPane.showMessageDialog(null, "com.javaBean.Article Title is already exist please try anotherone ", "Info", JOptionPane.INFORMATION_MESSAGE); - - request.setAttribute("title", title); - request.setAttribute("highlights", highlights); - request.setAttribute("abstracts", abstracts); - request.getRequestDispatcher("AuthorEdit.jsp").forward(request, response); - } - - else - { -*/ - - if(title.length() > 100) - { - //JOptionPane.showMessageDialog(null, "you have typed more than 100 letters in Highlights", "Info", JOptionPane.INFORMATION_MESSAGE); - request.getSession().setAttribute("info","title长度不能超过100个字符"); - request.setAttribute("title", oldtitle); - request.getRequestDispatcher("AuthorEdit.jsp").forward(request, response); - } - - else if(highlights.length() > 250) - { - //JOptionPane.showMessageDialog(null, "you have typed more than 250 letters in Highlights", "Info", JOptionPane.INFORMATION_MESSAGE); - request.getSession().setAttribute("info","highlight长度不能超过250个字符"); - request.setAttribute("title", oldtitle); - request.getRequestDispatcher("AuthorEdit.jsp").forward(request, response); - } - - else if(abstracts.length() > 999) - { - //JOptionPane.showMessageDialog(null, "you have typed more than 1000 letters in abstract", "Info", JOptionPane.INFORMATION_MESSAGE); - request.getSession().setAttribute("info","abstract长度不能超过999个字符"); - request.setAttribute("title", oldtitle); - request.getRequestDispatcher("AuthorEdit.jsp").forward(request, response); - } - - else - { - - Article a = new Article(); - a.setTitle(title); - a.setHighlights(highlights); - a.setAbstracts(abstracts); - a.setTime(time); - a.setOldtitle(oldtitle); - -// DB db = new DB(); - - try - { - db.updateArticle(a); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - request.getRequestDispatcher("AuthorHome.jsp").forward(request, response); - } -// } else - - } - - if(page.equals("delete")) - { - String title = request.getParameter("title"); - - DB db = new DB(); - - try - { - db.deleteArticle(title); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - request.getRequestDispatcher("AuthorHome.jsp").forward(request, response); - } - - -//---------------------------------------------------------------------------------------------- -// master function - - if(page.equals("master-home")) - { - request.getRequestDispatcher("Master.jsp").forward(request, response); - } - - if(page.equals("master-articles")) - { - request.getRequestDispatcher("MasterArticles.jsp").forward(request, response); - } - - if(page.equals("master-comments")) - { - request.getRequestDispatcher("Comments.jsp").forward(request, response); - } - - if(page.equals("master-authors")) - { - request.getRequestDispatcher("MasterAuthors.jsp").forward(request, response); - } - - if(page.equals("master-delete")) - { - String title = request.getParameter("title"); - - DB db = new DB(); - - try - { - db.deleteArticle(title); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - request.getRequestDispatcher("MasterArticles.jsp").forward(request, response); - } - - if(page.equals("master-view-article")) - { - String title = request.getParameter("title"); - - request.setAttribute("title", title); - request.getRequestDispatcher("MasterViewArticle.jsp").forward(request, response); - } - - if(page.equals("master-delete-comments")) - { - String comment = request.getParameter("comment"); - - DB db = new DB(); - - try - { - db.deleteComment(comment); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - request.getRequestDispatcher("Comments.jsp").forward(request, response); - } - - if(page.equals("master-block-author")) - { - String author = request.getParameter("author"); - - DB db = new DB(); - - try - { - db.blockAuthor(author); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - request.getRequestDispatcher("blocklist.jsp").forward(request, response); - } - - if(page.equals("master-release-author")) - { - String author = request.getParameter("author"); - - DB db = new DB(); - - try - { - db.releaseAuthor(author); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - request.getRequestDispatcher("MasterAuthors.jsp").forward(request, response); - } - - } - -} +package com.javaBeans; + +import java.io.IOException; +import java.sql.SQLException; +import java.sql.Timestamp; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import javax.swing.JOptionPane; + +import com.database.DB; +import com.javaBean.Article; +import com.javaBean.Author; + +/** + * Servlet implementation class AdminController + */ +@WebServlet("/AdminController") +public class AdminController extends HttpServlet { + HttpSession session; + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public AdminController() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException + { + String page = request.getParameter("page"); + + if(page == null) + { + request.getRequestDispatcher("AdminHome.jsp").forward(request, response); + } + + else + { + doPost(request, response); + } + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException + { + String page = request.getParameter("page"); + + if(page.equals("admin")) + { + String email = request.getParameter("email"); + String password = request.getParameter("password"); + + Author a = new Author(); + a.setEmail(email); + a.setPassword(password); + + DB db = new DB(); + boolean status = false; + + try + { + status = db.checkAuthor(a); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + if(status) + { + session = request.getSession(); + session.setAttribute("email", email); + request.getRequestDispatcher("AdminHome.jsp").forward(request, response); + } + + else + { + request.setAttribute("msg", "invalid"); + request.getRequestDispatcher("Admin.jsp").forward(request, response); + } + } + + if(page.equals("register")) + { + request.getRequestDispatcher("AdminRegister.jsp").forward(request, response); + } + + if(page.equals("register-form")) + { + String email = request.getParameter("email"); + String password = request.getParameter("password"); + String conpassword = request.getParameter("conpassword"); + + if(password.equals(conpassword)) + { + Author a = new Author(); + a.setEmail(email); + a.setPassword(password); + + DB db = new DB(); + + try + { + db.addAuthor(a); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + request.getRequestDispatcher("Admin.jsp").forward(request, response); + } + + else + { + request.getRequestDispatcher("AdminRegister.jsp").forward(request, response); + } + } + + if(page.equals("home")) + { + String email = request.getParameter("email"); + request.getRequestDispatcher("AdminHome.jsp").forward(request, response); + } + + if(page.equals("logout")) + { + request.getRequestDispatcher("Admin.jsp").forward(request, response); + } + + if(page.equals("edit")) + { + String title = request.getParameter("title"); + String email = request.getParameter("email"); + + request.setAttribute("title", title); + request.setAttribute("email", email); + request.getRequestDispatcher("AdminEdit.jsp").forward(request, response); + } + + if(page.equals("edit-form")) + { + String oldtitle = request.getParameter("old-title"); + + String title = request.getParameter("title"); + String highlights = request.getParameter("highlights"); + String abstracts = request.getParameter("abstracts"); + Timestamp time = new Timestamp(System.currentTimeMillis()); + + + DB db = new DB(); +/* boolean checkstatus = false; + + try + { + checkstatus = db.checktitle(title); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + if(checkstatus) + { + JOptionPane.showMessageDialog(null, "Article Title is already exist please try anotherone ", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("title", title); + request.setAttribute("highlights", highlights); + request.setAttribute("abstracts", abstracts); + request.getRequestDispatcher("AdminEdit.jsp").forward(request, response); + } + + else + { +*/ + + if(title.length() > 100) + { + JOptionPane.showMessageDialog(null, "you have typed more than 100 letters in Highlights", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("title", oldtitle); + request.getRequestDispatcher("AdminEdit.jsp").forward(request, response); + } + + else if(highlights.length() > 250) + { + JOptionPane.showMessageDialog(null, "you have typed more than 250 letters in Highlights", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("title", oldtitle); + request.getRequestDispatcher("AdminEdit.jsp").forward(request, response); + } + + else if(abstracts.length() > 999) + { + JOptionPane.showMessageDialog(null, "you have typed more than 1000 letters in abstract", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("title", oldtitle); + request.getRequestDispatcher("AdminEdit.jsp").forward(request, response); + } + + else + { + + Article a = new Article(); + a.setTitle(title); + a.setHighlights(highlights); + a.setAbstracts(abstracts); + a.setTime(time); + a.setOldtitle(oldtitle); + +// DB db = new DB(); + + try + { + db.updateArticle(a); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + request.getRequestDispatcher("AdminHome.jsp").forward(request, response); + } +// } else + + } + + if(page.equals("delete")) + { + String title = request.getParameter("title"); + + DB db = new DB(); + + try + { + db.deleteArticle(title); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + request.getRequestDispatcher("AdminHome.jsp").forward(request, response); + } + + +//---------------------------------------------------------------------------------------------- +// master function + + if(page.equals("master-home")) + { + request.getRequestDispatcher("Master.jsp").forward(request, response); + } + + if(page.equals("master-articles")) + { + request.getRequestDispatcher("MasterArticles.jsp").forward(request, response); + } + + if(page.equals("master-comments")) + { + request.getRequestDispatcher("Comments.jsp").forward(request, response); + } + + if(page.equals("master-authors")) + { + request.getRequestDispatcher("MasterAuthors.jsp").forward(request, response); + } + + if(page.equals("master-delete")) + { + String title = request.getParameter("title"); + + DB db = new DB(); + + try + { + db.deleteArticle(title); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + request.getRequestDispatcher("MasterArticles.jsp").forward(request, response); + } + + if(page.equals("master-view-article")) + { + String title = request.getParameter("title"); + + request.setAttribute("title", title); + request.getRequestDispatcher("MasterViewArticle.jsp").forward(request, response); + } + + if(page.equals("master-delete-comments")) + { + String comment = request.getParameter("comment"); + + DB db = new DB(); + + try + { + db.deleteComment(comment); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + request.getRequestDispatcher("Comments.jsp").forward(request, response); + } + + if(page.equals("master-block-author")) + { + String author = request.getParameter("author"); + + DB db = new DB(); + + try + { + db.blockAuthor(author); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + request.getRequestDispatcher("blocklist.jsp").forward(request, response); + } + + if(page.equals("master-release-author")) + { + String author = request.getParameter("author"); + + DB db = new DB(); + + try + { + db.releaseAuthor(author); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + request.getRequestDispatcher("MasterAuthors.jsp").forward(request, response); + } + + } + +} diff --git a/src/com/javaBeans/Controller.java b/src/com/javaBeans/Controller.java new file mode 100644 index 0000000..a56d4fe --- /dev/null +++ b/src/com/javaBeans/Controller.java @@ -0,0 +1,396 @@ +package com.javaBeans; + +import java.io.IOException; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Timestamp; + +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.swing.JOptionPane; + +import com.database.DB; + +/** + * Servlet implementation class Controller + */ +@WebServlet("/Controller") +public class Controller extends HttpServlet { + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public Controller() { + super(); + // TODO Auto-generated constructor stub + } + + /** + * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) + */ + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException + { + String page = request.getParameter("page"); + + if(page == null || page.equals("home")) + { + request.getRequestDispatcher("NewFile1.jsp").forward(request, response); + } + + else + { + doPost(request, response); + } + } + + /** + * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) + */ + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException + { + String page = request.getParameter("page"); + + + if(page.equals("like")) + { + String ip = request.getRemoteAddr(); + String title = request.getParameter("title"); + + int a = 1; + + DB db = new DB(); + boolean status = false; + + try + { + status = db.check_popular(ip, title, a); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + if(status) + { + request.setAttribute("title", title); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + + else + { + JOptionPane.showMessageDialog(null, "You have already liked the article.", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("title", title); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + } + + if(page.equals("dislike")) + { + String ip = request.getRemoteAddr(); + String title = request.getParameter("title"); + + int a = 0; + + DB db = new DB(); + boolean status = false; + + try + { + status = db.check_popular(ip, title, a); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + if(status) + { + request.setAttribute("title", title); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + + else + { + JOptionPane.showMessageDialog(null, "You have already disliked the article", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("title", title); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + } + + + if(page.equals("comments_like")) + { + String title = request.getParameter("title"); + String ip = request.getRemoteAddr(); + int id = Integer.parseInt(request.getParameter("id")); + + System.out.println(title); + System.out.println(ip); + + + int a = 1; + + DB db = new DB(); + boolean status = false; + + try + { + status = db.check_comments_popular(ip, id, a); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + if(status) + { + request.setAttribute("title", title); + request.setAttribute("id", id); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + + else + { + JOptionPane.showMessageDialog(null, "You have already liked the comment.", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("title", title); + request.setAttribute("id", id); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + } + + if(page.equals("comments_dislike")) + { + String title = request.getParameter("title"); + String ip = request.getRemoteAddr(); + int id = Integer.parseInt(request.getParameter("id")); + + int a = 0; + + DB db = new DB(); + boolean status = false; + + try + { + status = db.check_comments_popular(ip, id, a); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + if(status) + { + request.setAttribute("title", title); + request.setAttribute("id", id); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + + else + { + JOptionPane.showMessageDialog(null, "You have already disliked the comment", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("title", title); + request.setAttribute("id", id); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + + } + + + if(page.equals("home")) + { + request.getRequestDispatcher("NewFile1.jsp").forward(request, response); + } + + if(page.equals("aboutus")) + { + request.getRequestDispatcher("Aboutus.jsp").forward(request, response); + } + + if(page.equals("contact")) + { + request.getRequestDispatcher("Contact.jsp").forward(request, response); + } + + if(page.equals("admin")) + { + request.getRequestDispatcher("Admin.jsp").forward(request, response); + } + + if(page.equals("select")) + { + String option = request.getParameter("option"); + + if(option.equals("Articles")) + { + request.getRequestDispatcher("Articles.jsp").forward(request, response); + } + + if(option.equals("Comments")) + { + request.getRequestDispatcher("Comments.jsp").forward(request, response); + } + } + + if(page.equals("search")) + { + String search2 = request.getParameter("search2"); + + request.setAttribute("search2", search2); + request.getRequestDispatcher("Search.jsp").forward(request, response); + } + + if(page.equals("subject")) + { + String subject = request.getParameter("id"); + + request.setAttribute("subject", subject); + request.getRequestDispatcher("NewFile.jsp").forward(request, response); + } + + if(page.equals("post-article")) + { + String subject = request.getParameter("subject"); + String email = request.getParameter("email"); + + boolean status = false; + DB db = new DB(); + + try + { + status = db.checkblockauthor(email); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + if(status) + { + JOptionPane.showMessageDialog(null, "Sorry you have been blcoked, please contact Admin", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("subject", subject); + request.getRequestDispatcher("NewFile.jsp").forward(request, response); + } + + else + { + request.setAttribute("subject", subject); + request.setAttribute("email", email); + request.getRequestDispatcher("PostArticle.jsp").forward(request, response); + } + + } + + + if(page.equals("view-article")) + { + String title = request.getParameter("title"); + + request.setAttribute("title", title); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + + if(page.equals("admin-view-article")) + { + String title = request.getParameter("title"); + + request.setAttribute("title", title); + request.getRequestDispatcher("AdminViewArticle.jsp").forward(request, response); + } + + if(page.equals("comment-post")) + { + int id = Integer.parseInt(request.getParameter("id")); + String email = request.getParameter("email"); + String comment = request.getParameter("comment"); + String title = request.getParameter("title"); + Timestamp time = new Timestamp(System.currentTimeMillis()); + + String comment2 = comment.toLowerCase(); + if(comment2.contains("fuck") || comment2.contains("motherfucker") || comment2.contains("nigga") || comment2.contains("bitch") + || comment2.contains("idiot") || comment2.contains("stupid") || comment2.contains("dick") || comment2.contains("boobs") || comment2.contains("pussy") || comment2.contains("suck")) + { +// System.out.println("illegal"); + request.setAttribute("id", id); + request.setAttribute("title", title); + request.setAttribute("msg", "using improper words, please use proper words"); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + } + + else + { + + + try + { + String root ="root"; + String password = "1234"; + String url = "jdbc:mysql://localhost:3306/ooad?serverTimezone=UTC&&autoReconnect=true&&useSSL=false"; + String driver = "com.mysql.cj.jdbc.Driver"; + Connection con; + + Class.forName(driver); + + String sql = "insert into comments (title, user, comment, time,id) values (?,?,?,?,?)"; + + con = DriverManager.getConnection(url, root, password); + + PreparedStatement ps = con.prepareStatement(sql); + + ps.setString(1, title); + ps.setString(2, email); + ps.setString(3, comment); + ps.setTimestamp(4, time); + ps.setInt(5, id); + + ps.executeUpdate(); + + } + + catch (ClassNotFoundException e1) + { + e1.printStackTrace(); + } + + catch(SQLException e) + { + e.printStackTrace(); + } + +// System.out.println(email); +// System.out.println(comment); +// System.out.println(title); +// System.out.println(time); + + request.setAttribute("title", title); + request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); + + } + } + + if(page.equals("authorarticle")) + { + String author = request.getParameter("author"); + + request.setAttribute("author", author); + request.getRequestDispatcher("AuthorArticle.jsp").forward(request, response); + } + + } + +} diff --git a/src/main/java/com/javaBeans/DownloadServlet.java b/src/com/javaBeans/DownloadServlet.java similarity index 92% rename from src/main/java/com/javaBeans/DownloadServlet.java rename to src/com/javaBeans/DownloadServlet.java index 6c03c63..9c585de 100644 --- a/src/main/java/com/javaBeans/DownloadServlet.java +++ b/src/com/javaBeans/DownloadServlet.java @@ -1,156 +1,157 @@ -package com.javaBeans; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.OutputStream; -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 com.javaBeans.DownloadServlet - */ -@WebServlet("/com.javaBeans.DownloadServlet") -public class DownloadServlet extends HttpServlet { - - public static int BUFFER_SIZE = 1024*100; - public static final String UPLOAD_DIR = "resources"; - public static String fn = null; - - private static final long serialVersionUID = 1L; - - - public DownloadServlet() - { - super(); - - } - - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - -// fn = request.getParameter("fileName"); - -// response.setContentType("text/plain;charset=UTF-8"); - - PrintWriter out = response.getWriter(); - String filename = request.getParameter("fileName"); - String filepath = request.getServletContext().getRealPath("")+ UPLOAD_DIR+ File.separator; - response.setContentType("APPLICATION/OCTET-STREAM"); - response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\""); - - System.out.println(filename); - System.out.println(filepath); - - //use inline if you want to view the content in browser, helpful for pdf file - //response.setHeader("Content-Disposition","inline; filename=\"" + filename + "\""); - FileInputStream fileInputStream = new FileInputStream(filepath + filename); - - int i; - while ((i=fileInputStream.read()) != -1) { - out.write(i); - } - fileInputStream.close(); - out.close(); - } - - -/* if(fn.equals("") || fn == null) - { - response.setContentType("text/html"); - response.getWriter().println("File : " +fn+" is not exist "); - } - - else - { - String serverpath = request.getServletContext().getRealPath(""); - String downloadPath = serverpath + UPLOAD_DIR; - String filepath = downloadPath + File.separator + fn; - - System.out.println(fn); - System.out.println(filepath); - System.out.println("filename:" +fn); - System.out.println("filepath:" +filepath); - - File file = new File(filepath); - - OutputStream os = null; - FileInputStream is = null; - - if(file.exists()) - { - String mimetype ="APPLICATION/OCTET-STREAM"; - response.setContentType(mimetype); - - String headerKey = "Content-Disposition"; - String headervalue = String.format("attachment; filename=\""+fn+"\""); - response.setHeader(headerKey, headervalue); - - try - { - os = response.getOutputStream(); - is = new FileInputStream(file); - - int i; - - while ((i=is.read()) != -1) - { - out.write(i); - } - - is.close(); - out.close(); - - byte[] buffer = new byte[BUFFER_SIZE]; - int bytesread = -1; - - while((bytesread = is.read(buffer)) != -1) - { - os.write(buffer, 0, bytesread); - } - } - - catch(IOException e) - { - System.out.println("exception while performe: " +e.getMessage()); - } - - finally - { - if(is != null) - { - is.close(); - } - - os.flush(); - - if(os != null) - { - os.close(); - } - } - } - - else - { - response.setContentType("text/html"); - - response.getWriter().println("file: "+fn+" not exist"); - } - } - - } -*/ - - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - - } - -} +package com.javaBeans; + +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.OutputStream; +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 DownloadServlet + */ +@WebServlet("/DownloadServlet") +public class DownloadServlet extends HttpServlet { + + public static int BUFFER_SIZE = 1024*100; + public static final String UPLOAD_DIR = "resources"; + public static String fn = null; + + private static final long serialVersionUID = 1L; + + + public DownloadServlet() + { + super(); + + } + + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException + { + +// fn = request.getParameter("fileName"); + + response.setContentType("text/html"); + + PrintWriter out = response.getWriter(); + String filename = request.getParameter("fileName"); + String filepath = request.getServletContext().getRealPath("")+ UPLOAD_DIR+ File.separator; + response.setContentType("APPLICATION/OCTET-STREAM"); + response.setHeader("Content-Disposition","attachment; filename=\"" + filename + "\""); + + System.out.println(filename); + System.out.println(filepath); + + //use inline if you want to view the content in browser, helpful for pdf file + //response.setHeader("Content-Disposition","inline; filename=\"" + filename + "\""); + FileInputStream fileInputStream = new FileInputStream(filepath + filename); + + int i; + while ((i=fileInputStream.read()) != -1) { + out.write(i); + } + fileInputStream.close(); + out.close(); + } + + +/* if(fn.equals("") || fn == null) + { + response.setContentType("text/html"); + response.getWriter().println("File : " +fn+" is not exist "); + } + + else + { + String serverpath = request.getServletContext().getRealPath(""); + String downloadPath = serverpath + UPLOAD_DIR; + String filepath = downloadPath + File.separator + fn; + + System.out.println(fn); + System.out.println(filepath); + System.out.println("filename:" +fn); + System.out.println("filepath:" +filepath); + + File file = new File(filepath); + + OutputStream os = null; + FileInputStream is = null; + + if(file.exists()) + { + String mimetype ="APPLICATION/OCTET-STREAM"; + response.setContentType(mimetype); + + String headerKey = "Content-Disposition"; + String headervalue = String.format("attachment; filename=\""+fn+"\""); + response.setHeader(headerKey, headervalue); + + try + { + os = response.getOutputStream(); + is = new FileInputStream(file); + + int i; + + while ((i=is.read()) != -1) + { + out.write(i); + } + + is.close(); + out.close(); + + byte[] buffer = new byte[BUFFER_SIZE]; + int bytesread = -1; + + while((bytesread = is.read(buffer)) != -1) + { + os.write(buffer, 0, bytesread); + } + } + + catch(IOException e) + { + System.out.println("exception while performe: " +e.getMessage()); + } + + finally + { + if(is != null) + { + is.close(); + } + + os.flush(); + + if(os != null) + { + os.close(); + } + } + } + + else + { + response.setContentType("text/html"); + + response.getWriter().println("file: "+fn+" not exist"); + } + } + + } +*/ + + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException + { + + } + +} diff --git a/src/com/javaBeans/UploadServlet.java b/src/com/javaBeans/UploadServlet.java new file mode 100644 index 0000000..cf290c3 --- /dev/null +++ b/src/com/javaBeans/UploadServlet.java @@ -0,0 +1,233 @@ +package com.javaBeans; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.PrintWriter; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.PreparedStatement; +import java.sql.SQLException; +import java.sql.Timestamp; + +import javax.servlet.ServletException; +import javax.servlet.annotation.MultipartConfig; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import javax.servlet.http.Part; +import javax.swing.JOptionPane; + +import org.apache.catalina.core.ApplicationPart; + +import com.database.DB; + +/** + * Servlet implementation class UploadServlet + */ +@WebServlet("/UploadServlet") +@MultipartConfig(fileSizeThreshold = 1024 *1024 * 10, + maxFileSize = 1024 * 1024 * 1000, + maxRequestSize = 1024 * 1024 *1000) +public class UploadServlet extends HttpServlet { + + PrintWriter out = null; + Connection con = null; + PreparedStatement ps = null; + HttpSession session = null; + + private static final long serialVersionUID = 1L; + + /** + * @see HttpServlet#HttpServlet() + */ + public UploadServlet() { + super(); + // TODO Auto-generated constructor stub + } + + + protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException + { + + } + + + protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { + + String author = request.getParameter("author"); + String subject = request.getParameter("subject"); + String title = request.getParameter("title"); + String highlights = request.getParameter("highlights"); + String abstracts = request.getParameter("abstracts"); + + + DB db = new DB(); + boolean checkstatus = false; + + try + { + checkstatus = db.checktitle(title); + + } + + catch(SQLException e) + { + e.printStackTrace(); + } + + if(checkstatus) + { + JOptionPane.showMessageDialog(null, "The article title already exists.\nPlease use another one. ", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("author", author); + request.setAttribute("subject", subject); + request.setAttribute("title", title); + request.setAttribute("highlights", highlights); + request.setAttribute("abstracts", abstracts); + request.getRequestDispatcher("PostArticle.jsp").forward(request, response); + } + + else + { + +// --------------------------------------------------------------------------------------------------------------- + + response.setContentType("text/plain;charset=UTF=8"); + + try + { + out = response.getWriter(); + session = request.getSession(false); + + String folderName = "resources"; + String uploadPath = request.getServletContext().getRealPath("") + folderName; + + File dir = new File (uploadPath); + + if(!dir.exists()) + { + dir.mkdir(); + } + + Timestamp time = new Timestamp(System.currentTimeMillis()); + + Part filePart = request.getPart("file"); + String fileName = filePart.getSubmittedFileName(); + + String path = folderName + File.separator + fileName; + String fileType = filePart.getContentType();// get the uploaded file type + + //----------------------------------------------------- + System.out.print(fileType); + //------------------------------------------------------ + + + // if the uploaded file type is PDF, then upload the file to the server + if(fileType.equals("application/pdf")) { + + InputStream is = filePart.getInputStream(); + Files.copy(is, Paths.get(uploadPath + File.separator + fileName), StandardCopyOption.REPLACE_EXISTING); + + //----------------------------------------------------- + System.out.print("2"); + //------------------------------------------------------ + + try + { + Class.forName("com.mysql.cj.jdbc.Driver"); + + String u = "root"; + String password = "1234"; + String ul ="jdbc:mysql://localhost:3306/ooad?serverTimezone=UTC&&autoReconnect=true&&useSSL=false"; + + con = DriverManager.getConnection(ul, u, password); + + String sql = "insert into article(subject, title, highlight, abstracts, author, time, filename, path) values (?,?,?,?,?,?,?,?)"; + + ps = con.prepareStatement(sql); + + ps.setString(1, subject); + ps.setString(2, title); + ps.setString(3, highlights); + ps.setString(4, abstracts); + ps.setString(5, author); + ps.setTimestamp(6, time); + ps.setString(7, fileName); + ps.setString(8, path); + + int status = ps.executeUpdate(); + + if(status>0) + { + session.setAttribute("fileName", fileName); + String msg = "" +fileName+ " upload successfully"; + request.setAttribute("msg", msg); + request.setAttribute("subject", subject); + request.getRequestDispatcher("NewFile.jsp").forward(request, response); + + } + + } + + catch(SQLException | ClassNotFoundException e) + { + System.out.println(e); + } + + finally + { + try + { + if(ps != null) + { + ps.close(); + } + + if(con!=null) + { + con.close(); + } + } + + catch(SQLException e) + { + out.println(e); + } + } + + }else {// if the uploaded file type is not PDF, show an alert message + + //----------------------------------------------------- + System.out.print("3"); + //------------------------------------------------------ + + + JOptionPane.showMessageDialog(null, "Unsupported file format!.\nOnly PDF files are supported. ", "Info", JOptionPane.INFORMATION_MESSAGE); + + request.setAttribute("author", author); + request.setAttribute("subject", subject); + request.setAttribute("title", title); + request.setAttribute("highlights", highlights); + request.setAttribute("abstracts", abstracts); + request.getRequestDispatcher("PostArticle.jsp").forward(request, response); + + } + + + } + + catch(IOException | ServletException e) + { + out.println(e); + } + } + + } + +} diff --git a/src/main/java/com/filter/Filter_AdminLogin.java b/src/main/java/com/filter/Filter_AdminLogin.java deleted file mode 100644 index 758642d..0000000 --- a/src/main/java/com/filter/Filter_AdminLogin.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.filter; - -import com.database.DB; -import com.javaBean.Author; - -import javax.servlet.*; -import javax.servlet.annotation.WebFilter; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.sql.SQLException; - -@WebFilter(value={"/AdministratorHome.jsp","/AdministratorEdit.jsp","/AddSubject.jsp"},dispatcherTypes= {DispatcherType.REQUEST,DispatcherType.FORWARD}) -public class Filter_AdminLogin implements Filter { - @Override - public void init(FilterConfig filterConfig) throws ServletException { - - } - - @Override - public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { - HttpSession session=((HttpServletRequest) request).getSession(); - if(session.getAttribute("admin_login")!=null) - { - chain.doFilter(request, response); - } - else - { - request.setAttribute("advice","If you are an administrator,login in first "); - request.getRequestDispatcher("Administrator.jsp").forward(request,response); - } - } - - @Override - public void destroy() { - - } -} diff --git a/src/main/java/com/javaBean/Administrator.java b/src/main/java/com/javaBean/Administrator.java deleted file mode 100644 index f1e5a32..0000000 --- a/src/main/java/com/javaBean/Administrator.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.javaBean; - -public class Administrator { - public String email, password; - - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - -} diff --git a/src/main/java/com/javaBean/Subject.java b/src/main/java/com/javaBean/Subject.java deleted file mode 100644 index e8ca4cf..0000000 --- a/src/main/java/com/javaBean/Subject.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.javaBean; - -import java.sql.Timestamp; - -public class Subject { - public int sid; - public String subject; - public Timestamp sdate; - public String oldsubject; - public int parentsid; - - public int getParentsid() { - return parentsid; - } - - public void setParentsid(int parentsid) { - this.parentsid = parentsid; - } - - public String getOldsubject() { - return oldsubject; - } - - public void setOldsubject(String oldsubject) { - this.oldsubject = oldsubject; - } - - public int getSid() { - return sid; - } - - public void setSid(int sid) { - this.sid = sid; - } - - public String getSubject() { - return subject; - } - - public void setSubject(String subject) { - this.subject = subject; - } - - public Timestamp getSdate() { - return sdate; - } - - public void setSdate(Timestamp sdate) { - this.sdate = sdate; - } -} diff --git a/src/main/java/com/javaBeans/AdministorController.java b/src/main/java/com/javaBeans/AdministorController.java deleted file mode 100644 index 1f32ba4..0000000 --- a/src/main/java/com/javaBeans/AdministorController.java +++ /dev/null @@ -1,172 +0,0 @@ -package com.javaBeans; - - -import com.database.DB; -import com.javaBean.Administrator; -import com.javaBean.Subject; - -import javax.servlet.ServletException; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.sql.SQLException; -import java.sql.Timestamp; - -@WebServlet(name = "AdministorController") -public class AdministorController extends HttpServlet { - HttpSession session; - protected void doGet (HttpServletRequest request, HttpServletResponse response) throws - ServletException, IOException { - doPost(request, response); - } - - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - String page = request.getParameter("page"); - - if (page.equals("administrator")) { - String email = request.getParameter("email"); - String password = request.getParameter("password"); - Administrator a = new Administrator(); - a.setEmail(email); - a.setPassword(password); - - DB db = new DB(); - boolean status = false; - - try { - status = db.checkAdministrator(a); - } catch (SQLException e) { - e.printStackTrace(); - } - - if (status) { - HttpSession session = request.getSession(); - session.setAttribute("admin_login","yes"); - - request.getRequestDispatcher("AdministratorHome.jsp").forward(request, response); - } else { - request.setAttribute("msg", "invalid"); - request.getRequestDispatcher("Administrator.jsp").forward(request, response); - } - } - if (page.equals("logout")) { - HttpSession session = request.getSession(); - session.setAttribute("admin_login",null); - request.getRequestDispatcher("Administrator.jsp").forward(request, response); - } - if (page.equals("add")) { - String parentsid = request.getParameter("parentsid"); - request.setAttribute("parentsid",parentsid); - request.getRequestDispatcher("AddSubject.jsp").forward(request, response); - } - if (page.equals("addSubject")) { - int parentsid=0; - String parent = request.getParameter("parentsid"); - if (!parent.equals("")) - { - parentsid=Integer.parseInt(parent); - - } - - String subject = request.getParameter("subject"); - Subject sub = new Subject(); - Timestamp time = new Timestamp(System.currentTimeMillis()); - sub.setSdate(time); - sub.setSubject(subject); - sub.setParentsid(parentsid); - DB db = new DB(); - try { - db.addSubject(sub); - } catch (SQLException e) { - e.printStackTrace(); - } - request.getRequestDispatcher("AdministratorHome.jsp").forward(request,response); - - - } - if (page.equals("edit")) { - String subject = request.getParameter("subject"); - - - request.setAttribute("subject", subject); - - request.getRequestDispatcher("AdministratorEdit.jsp").forward(request, response); - } - if(page.equals("delete")) - { - String i = request.getParameter("sid"); - - DB db = new DB(); - - try - { - db.deleteSubject(Integer.parseInt(i)); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - request.getRequestDispatcher("AdministratorHome.jsp").forward(request, response); - } - if (page.equals("edit-form")) { - String oldsubject = request.getParameter("oldsubject"); - - String newsubject = request.getParameter("newsubject"); - System.out.println("oldsubject"+oldsubject); - System.out.println("newsubject"+newsubject); - - Timestamp time = new Timestamp(System.currentTimeMillis()); - - - DB db = new DB(); - boolean checkstatus = false; - - try { - checkstatus = db.checksubject(newsubject); - } catch (SQLException e) { - e.printStackTrace(); - } - - if (checkstatus) { - //JOptionPane.showMessageDialog(null, "com.javaBean.Article Title is already exist please try anotherone ", "Info", JOptionPane.INFORMATION_MESSAGE); - - request.setAttribute("subject", oldsubject); - - request.getRequestDispatcher("AdministratorEdit.jsp").forward(request, response); - } else { - - - if (newsubject.length() > 30) { - //JOptionPane.showMessageDialog(null, "you have typed more than 100 letters in Highlights", "Info", JOptionPane.INFORMATION_MESSAGE); - request.getSession().setAttribute("info", "subject name长度不能超过30个字符"); - request.setAttribute("subject", oldsubject); - request.getRequestDispatcher("AuthorEdit.jsp").forward(request, response); - } else { - Subject s = new Subject(); - s.setOldsubject(oldsubject); - s.setSubject(newsubject); - s.setSdate(time); - - - try { - db.updateSubject(s); - } catch (SQLException e) { - e.printStackTrace(); - } - - request.getRequestDispatcher("AdministratorHome.jsp").forward(request, response); - } -// } else - - } - - } - - } - -} diff --git a/src/main/java/com/javaBeans/Controller.java b/src/main/java/com/javaBeans/Controller.java deleted file mode 100644 index b3ce896..0000000 --- a/src/main/java/com/javaBeans/Controller.java +++ /dev/null @@ -1,419 +0,0 @@ -package com.javaBeans; -import com.database.DB; -import java.io.IOException; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.PreparedStatement; -import java.sql.SQLException; -import java.sql.Timestamp; -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 com.javaBeans.Controller - */ -@WebServlet("/com.javaBeans.Controller") -public class Controller extends HttpServlet { - private static final long serialVersionUID = 1L; - - /** - * @see HttpServlet#HttpServlet() - */ - public Controller() { - super(); - // TODO Auto-generated constructor stub - } - - /** - * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) - */ - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - String page = request.getParameter("page"); - - if(page == null || page.equals("home")) - { - request.getRequestDispatcher("index.jsp").forward(request, response); - } - - else - { - doPost(request, response); - } - } - - /** - * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) - */ - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException - { - String page = request.getParameter("page"); - - - if(page.equals("like")||page.equals("dislike")) - { - String ip = request.getRemoteAddr(); - String title = request.getParameter("title"); - - int a = -1; - if(page.equals("like")) - { - a=1; - } - else if(page.equals("dislike")) - { - a=0; - } - DB db = new DB(); - boolean status = false; - - try - { -// status = db.check_popular(ip, title, a); - db.check_popular(ip, title, a); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - -// if(status) -// { - request.setAttribute("title", title); - request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); -// } -// -// else -// { -// JOptionPane.showMessageDialog(null, "You have already liked the article.", "Info", JOptionPane.INFORMATION_MESSAGE); -// -// request.setAttribute("title", title); -// request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); -// } - } - -// if(page.equals("dislike")) -// { -// String ip = request.getRemoteAddr(); -// String title = request.getParameter("title"); -// -// int a = 0; -// -// DB db = new DB(); -// boolean status = false; -// -// try -// { -//// status = db.check_popular(ip, title, a); -// db.check_popular(ip, title, a); -// } -// -// catch(SQLException e) -// { -// e.printStackTrace(); -// } -// -//// if(status) -//// { -// request.setAttribute("title", title); -// request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); -//// } -//// -//// else -//// { -//// JOptionPane.showMessageDialog(null, -//// "You have already disliked the article", "Info", JOptionPane.INFORMATION_MESSAGE); -//// -//// request.setAttribute("title", title); -//// request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); -//// } -// } -// - - if(page.equals("comments_like")||page.equals("comments_dislike")) - { - int a=-1; - String title = request.getParameter("title"); - String ip = request.getRemoteAddr(); - int id = Integer.parseInt(request.getParameter("id")); - if(page.equals("comments_like")) - { - a = 1; - } - else if(page.equals("comments_dislike")) - { - a=0; - } - - - DB db = new DB(); - boolean status = false; - - try - { -// status = db.check_comments_popular(ip, id, a); - db.check_comments_popular(ip, id, a); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - -// if(status) -// { - request.setAttribute("title", title); - request.setAttribute("id", id); - request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); -// } -// -// else -// { -// JOptionPane.showMessageDialog(null, "You have already liked the comment.", "Info", JOptionPane.INFORMATION_MESSAGE); - -// request.setAttribute("title", title); -// request.setAttribute("id", id); -// request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); -// } - } - -// if(page.equals("comments_dislike")) -// { -// String title = request.getParameter("title"); -// String ip = request.getRemoteAddr(); -// int id = Integer.parseInt(request.getParameter("id")); -// -// int a = 0; -// -// DB db = new DB(); -// boolean status = false; -// -// try -// { -//// status = db.check_comments_popular(ip, id, a); -// db.check_comments_popular(ip, id, a); -// } -// -// catch(SQLException e) -// { -// e.printStackTrace(); -// } -// -//// if(status) -//// { -// request.setAttribute("title", title); -// request.setAttribute("id", id); -// request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); -//// } -//// -//// else -//// { -//// JOptionPane.showMessageDialog(null, "You have already disliked the comment", "Info", JOptionPane.INFORMATION_MESSAGE); -//// -//// request.setAttribute("title", title); -//// request.setAttribute("id", id); -//// request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); -//// } -// -// } - - if(page.equals("administrator")) - { - if (request.getSession().getAttribute("admin_login")!=null) - { - request.getRequestDispatcher("AdministratorHome.jsp").forward(request, response); - - } - else { - request.getRequestDispatcher("Administrator.jsp").forward(request, response); - } - } - if(page.equals("home")) - { - request.getRequestDispatcher("index.jsp").forward(request, response); - } - - if(page.equals("aboutus")) - { - request.getRequestDispatcher("Aboutus.jsp").forward(request, response); - } - - if(page.equals("contact")) - { - request.getRequestDispatcher("Contact.jsp").forward(request, response); - } - - if(page.equals("admin")) - { - - if (request.getSession().getAttribute("admin_login")!=null) - { - request.getRequestDispatcher("AuthorHome.jsp").forward(request, response); - - } - else - { - request.getRequestDispatcher("Author.jsp").forward(request, response); - } - - } - - if(page.equals("select")) - { - String option = request.getParameter("option"); - - if(option.equals("Articles")) - { - request.getRequestDispatcher("Articles.jsp").forward(request, response); - } - - if(option.equals("Comments")) - { - request.getRequestDispatcher("Comments.jsp").forward(request, response); - } - } - - if(page.equals("search")) - { - String search2 = request.getParameter("search2"); - - request.setAttribute("search2", search2); - request.getRequestDispatcher("Search.jsp").forward(request, response); - } - - if(page.equals("subject")) - { - String subject = request.getParameter("id"); - - request.setAttribute("subject", subject); - - request.getRequestDispatcher("NewFile.jsp").forward(request, response); -// response.sendRedirect("NewFile.jsp"); - } - - if(page.equals("post-article")) - { - String subject = request.getParameter("subject"); - String email = request.getParameter("email"); - - boolean status = false; - DB db = new DB(); - - try - { - status = db.checkblockauthor(email); - } - - catch(SQLException e) - { - e.printStackTrace(); - } - - if(status) - { - //JOptionPane.showMessageDialog(null, "Sorry you have been blcoked, please contact Author", "Info", JOptionPane.INFORMATION_MESSAGE); - - request.setAttribute("subject", subject); - request.getRequestDispatcher("NewFile.jsp").forward(request, response); - } - - else - { - request.setAttribute("subject", subject); - request.setAttribute("email", email); - request.getRequestDispatcher("PostArticle.jsp").forward(request, response); - } - - } - - - if(page.equals("view-article")) - { - String title = request.getParameter("title"); - - request.setAttribute("title", title); - request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); - } - - if(page.equals("admin-view-article")) - { - String title = request.getParameter("title"); - - request.setAttribute("title", title); - request.getRequestDispatcher("AuthorViewArticle.jsp").forward(request, response); - } - - if(page.equals("comment-post")) - { - - String email = request.getParameter("email"); - String comment = request.getParameter("comment"); - String title = request.getParameter("title"); - Timestamp time = new Timestamp(System.currentTimeMillis()); - - String comment2 = comment.toLowerCase(); - if (comment2.contains("fuck") || comment2.contains("motherfucker") || comment2.contains("nigga") || comment2.contains("bitch") - || comment2.contains("idiot") || comment2.contains("stupid") || comment2.contains("dick") || comment2.contains("boobs") || comment2.contains("pussy") || comment2.contains("suck")) { -// System.out.println("illegal"); - request.setAttribute("title", title); - request.setAttribute("msg", "using improper words, please use proper words"); - request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); - } else { - - - try { - String root = "wzf"; - String password = "wzf"; - String url = "jdbc:mysql://47.115.56.157:3306/oo?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8"; - String driver = "com.mysql.jdbc.Driver"; - Connection con; - - Class.forName(driver); - - String sql = "insert into comments (title, user, comment, time) values (?,?,?,?)"; - - con = DriverManager.getConnection(url, root, password); - - PreparedStatement ps = con.prepareStatement(sql); - - ps.setString(1, title); - ps.setString(2, email); - ps.setString(3, comment); - ps.setTimestamp(4, time); - - ps.executeUpdate(); - - } catch (ClassNotFoundException e1) { - e1.printStackTrace(); - } catch (SQLException e) { - e.printStackTrace(); - } - -// System.out.println(email); -// System.out.println(comment); -// System.out.println(title); -// System.out.println(time); - - request.setAttribute("title", title); - request.getRequestDispatcher("ViewArticle.jsp").forward(request, response); - - } - - - } - - if(page.equals("authorarticle")) - { - String author = request.getParameter("author"); - - request.setAttribute("author", author); - request.getRequestDispatcher("AuthorArticle.jsp").forward(request, response); - } - - } - -} diff --git a/src/main/java/com/javaBeans/UploadServlet.java b/src/main/java/com/javaBeans/UploadServlet.java deleted file mode 100644 index 9927b04..0000000 --- a/src/main/java/com/javaBeans/UploadServlet.java +++ /dev/null @@ -1,214 +0,0 @@ -package com.javaBeans; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.PrintWriter; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; -import java.sql.*; -import javax.servlet.ServletException; -import javax.servlet.annotation.MultipartConfig; -import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.Part; - - -import com.database.DB; -/** - * Servlet implementation class com.javaBeans.UploadServlet - */ -@WebServlet("/com.javaBeans.UploadServlet") -@MultipartConfig(fileSizeThreshold = 1024 * 1024 * 10, - maxFileSize = 1024 * 1024 * 1000, - maxRequestSize = 1024 * 1024 * 1000) -public class UploadServlet extends HttpServlet { - - PrintWriter out = null; - Connection con = null; - PreparedStatement ps = null; - HttpSession session = null; - - private static final long serialVersionUID = 1L; - - /** - * @see HttpServlet#HttpServlet() - */ - public UploadServlet() { - super(); - // TODO Auto-generated constructor stub - } - - - protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - - } - - - protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - Part filePart = request.getPart("file"); - response.setContentType("text/plain;charset=UTF-8"); - String author = request.getParameter("author"); - String subject = request.getParameter("subject"); - String title = request.getParameter("title"); - String highlights = request.getParameter("highlights"); - String abstracts = request.getParameter("abstracts"); - request.setAttribute("email", author); - request.setAttribute("subject", subject); - request.setAttribute("title", title); - request.setAttribute("highlights", highlights); - request.setAttribute("abstracts", abstracts); - DB db = new DB(); - boolean checkstatus = false; - - try { - checkstatus = db.checktitle(title); - } catch (SQLException e) { - e.printStackTrace(); - } -// response.setContentType("text/plain;charset=UTF-8"); - if (checkstatus) { - request.getSession().setAttribute("suggestion", "已经存在的article title,不能重复发布哦"); - //JOptionPane.showMessageDialog(null, "The article title already exists.\nPlease use another one. ", "Info", JOptionPane.INFORMATION_MESSAGE); - -// request.setAttribute("email", author); -// request.setAttribute("subject", subject); -// request.setAttribute("title", title); -// request.setAttribute("highlights", highlights); -// request.setAttribute("abstracts", abstracts); - request.getRequestDispatcher("PostArticle.jsp").forward(request, response); - } else { - -// --------------------------------------------------------------------------------------------------------------- - - - try { - out = response.getWriter(); - session = request.getSession(false); - - String folderName = "resources"; - String uploadPath = request.getServletContext().getRealPath("") + folderName; - - File dir = new File(uploadPath); - - if (!dir.exists()) { - dir.mkdir(); - } - - Timestamp time = new Timestamp(System.currentTimeMillis()); - -// response.setContentType("application/octet-stream"); -// Part filePart = request.getPart("file"); - String fileType = filePart.getContentType();// get the uploaded file type -// String fileName = filePart.getSubmittedFileName(); - String cd = filePart.getHeader("Content-Disposition"); - String fileName = cd.substring(cd.lastIndexOf("=") + 2, cd.length() - 1); - String path = folderName + File.separator + fileName; - - - - // if the uploaded file type is PDF, then upload the file to the server - if (fileType.equals("application/pdf")) { -// - File file = new File(uploadPath+File.separator + fileName); - System.out.println(file.length()/(1024.0*1024)); - if (file.length()/(1024.0*1024)>20) - { - request.setAttribute("suggestion","The size of file can not exceed 20MB"); - request.getRequestDispatcher("PostArticle.jsp").forward(request, response); - } - else { - - - InputStream is = filePart.getInputStream(); - Files.copy(is, Paths.get(uploadPath + File.separator + fileName), StandardCopyOption.REPLACE_EXISTING); - - try { - Class.forName("com.mysql.jdbc.Driver"); - - String u = "wzf"; - String password = "wzf"; - String ul = "jdbc:mysql://47.115.56.157:3306/oo?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8"; - - con = DriverManager.getConnection(ul, u, password); - String sql0="select sid from subject where subject=?"; - ps = con.prepareStatement(sql0); - ps.setString(1,subject); - ResultSet resultSet = ps.executeQuery(); - int sid=0; - if (resultSet.next()) - { - sid = resultSet.getInt("sid"); - } - - String sql = "insert into article(sid, title, highlight, abstracts, author, time, filename, path,hide) values (?,?,?,?,?,?,?,?,?)"; - - ps = con.prepareStatement(sql); - - ps.setInt(1, sid); - ps.setString(2, title); - ps.setString(3, highlights); - ps.setString(4, abstracts); - ps.setString(5, author); - ps.setTimestamp(6, time); - ps.setString(7, fileName); - ps.setString(8, path); - ps.setString(9,"No"); - - int status = ps.executeUpdate(); - - if (status > 0) { - session.setAttribute("fileName", fileName); - String msg = "" + fileName + " upload successfully"; - request.setAttribute("msg", msg); - - - request.setAttribute("subject", subject); - request.getRequestDispatcher("NewFile.jsp").forward(request, response); - - } - - } catch (SQLException | ClassNotFoundException e) { - System.out.println(e); - } finally { - try { - if (ps != null) { - ps.close(); - } - - if (con != null) { - con.close(); - } - } catch (SQLException e) { - out.println(e); - } - } - } - - } else { - // if the uploaded file type is not PDF, show an alert message - -// JOptionPane.showMessageDialog(null, "Unsupported file format!.\nOnly PDF files are supported. ", "Info", JOptionPane.INFORMATION_MESSAGE); - -// request.setAttribute("email", author); -// request.setAttribute("subject", subject); -// request.setAttribute("title", title); -// request.setAttribute("highlights", highlights); -// request.setAttribute("abstracts", abstracts); - request.setAttribute("suggestion","Unsupported file format!.\nOnly PDF files are supported."); - request.getRequestDispatcher("PostArticle.jsp").forward(request, response); - - } - - - } catch (IOException | ServletException e) { - out.println(e); - } - } - - } - -} diff --git a/src/main/webapp/Aboutus.jsp b/src/main/webapp/Aboutus.jsp deleted file mode 100644 index 4b68ece..0000000 --- a/src/main/webapp/Aboutus.jsp +++ /dev/null @@ -1,139 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -About us - - - - - - -
- -
-
团队成员:吴钟富,唐震,卓晨曦,庄梓淇
-
- 2020 copyright©Wu Zhongfu -
- - - diff --git a/src/main/webapp/AddSubject.jsp b/src/main/webapp/AddSubject.jsp deleted file mode 100644 index b2bddd2..0000000 --- a/src/main/webapp/AddSubject.jsp +++ /dev/null @@ -1,99 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> - - - - - Insert title here - - - - - - - -
-

Welcome Administrator

- -
- - -

${info}

-
- - - - - - - - - - - - - -
- -
- -<%----%> - -
- 2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/Administrator.jsp b/src/main/webapp/Administrator.jsp deleted file mode 100644 index b47e811..0000000 --- a/src/main/webapp/Administrator.jsp +++ /dev/null @@ -1,172 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - - - - - - - Admin - - - - - - -
- -
- - -
- - - - - - - - -

Admin Login

Apply for administrator account
-
-

${advice}

- - -
- 2020 copyright©Wu Zhongfu -
- - - diff --git a/src/main/webapp/AdministratorEdit.jsp b/src/main/webapp/AdministratorEdit.jsp deleted file mode 100644 index 4214946..0000000 --- a/src/main/webapp/AdministratorEdit.jsp +++ /dev/null @@ -1,122 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> - - - - - Insert title here - - - - - - - -
-

Welcome Administrator

- -
- - - -<%----%> -<%----%> - <%--select * from subject where subject='<%= request.getAttribute("subject")%>'--%> -<%----%> - -<%----%> - -

${info}

-
- - "> - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current Subject Name
" readonly style="background:lightgray">
New Subject Name
- -
- -<%--
--%> - -
- 2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/AdministratorHome.jsp b/src/main/webapp/AdministratorHome.jsp deleted file mode 100644 index afb4480..0000000 --- a/src/main/webapp/AdministratorHome.jsp +++ /dev/null @@ -1,131 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> - - - - - - Author Home - - - - - - - - - select * from subject order by parentsid - - -
-

Admin Subject

- -
- - - -
- - - - - - - - - - - - - - - - - - - -
SubjectIdNameParentIdLastModificationTime
edit || - delete - - || - AddChildSubject - - -
-
- -
- 2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/Author.jsp b/src/main/webapp/Author.jsp deleted file mode 100644 index 6d05f9a..0000000 --- a/src/main/webapp/Author.jsp +++ /dev/null @@ -1,172 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - - - - - - -Admin - - - - - - -
- -
- - -
- - - - - - - - -

Admin Login

register
-
-

${advice}

- - -
-2020 copyright©Wu Zhongfu -
- - - diff --git a/src/main/webapp/AuthorEdit.jsp b/src/main/webapp/AuthorEdit.jsp deleted file mode 100644 index 57ce0ea..0000000 --- a/src/main/webapp/AuthorEdit.jsp +++ /dev/null @@ -1,134 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> - - - - - Insert title here - - - - - - - -
-

Welcome Author

- -
- - - - - - select * from article a , subject s where a.sid=s.sid and title='<%= request.getAttribute("title")%>' - - - - -

${info}

-
- - "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current Subject
" readonly style="background:lightgray">
Title
" placeholder="Enter title" required>
Highlights
" placeholder="Enter highlights" required>
Abstract
" placeholder="Enter abstract" required>
-
- -
- -
- 2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/AuthorRegister.jsp b/src/main/webapp/AuthorRegister.jsp deleted file mode 100644 index 814a9f7..0000000 --- a/src/main/webapp/AuthorRegister.jsp +++ /dev/null @@ -1,179 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - - - - - -Author Register - - - - - - -
- -
- - -
- - - - - - - - - - - -

Registration

email
password
confirm password
-
- - -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/Master.jsp b/src/main/webapp/Master.jsp deleted file mode 100644 index 8a9393a..0000000 --- a/src/main/webapp/Master.jsp +++ /dev/null @@ -1,64 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Master Author - - - - - - - -
-

Welcome Author

- -
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/MasterAuthors.jsp b/src/main/webapp/MasterAuthors.jsp deleted file mode 100644 index 96b142e..0000000 --- a/src/main/webapp/MasterAuthors.jsp +++ /dev/null @@ -1,123 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - -Master Author - - - - - - - -
-

Welcome Author

- -
- - - - -select author from article where author not in (select email from block_author) - - -
- - - - - - - - - - - - -
AuthorOption
block
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/ViewArticle.jsp b/src/main/webapp/ViewArticle.jsp deleted file mode 100644 index e6352a7..0000000 --- a/src/main/webapp/ViewArticle.jsp +++ /dev/null @@ -1,420 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - -View Article - - - - - - - -
- -
- - - - -select * from article a , subject s where a.sid=s.sid and title="${ title}"; - - -<%---------------------------------------------------------------------- --%> - - -select * from love_article where prefer=1 and title="${ title}"; - - - - - - - - -<%---------------------------------------------------------------------- --%> - - -select * from love_article where prefer=0 and title="${ title}"; - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -

Abstract
Highlight
Publication Date
Author
-
- - - - -
-
- - - - -
-Download -
-
- -
- -
- - - - - - - -
-
- -
- - -select * from comments where title="${ title}" - - -<%---------------------------------------------------------------------- --%> -<%-- This block is the comment box, where the comment, user, and time are - going to be displayed. - --%> - - -
- - - - - - - -

- - - - - -select * from love_comment where prefer=1 and cid="${ row.id}"; - - - - - - - - -
- - - - - -
- - - - - -select * from love_comment where prefer=0 and cid="${ row.id}"; - - - - - - - - - -
- - - - - -
- - - -
-
- -

- -
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/web.xml b/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index be876ea..0000000 --- a/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - OOAD - - index.html - index.htm - index.jsp - default.html - default.htm - default.jsp - - - Controller - com.javaBeans.Controller - - - Controller - /Controller - - - AuthorController - com.javaBeans.AuthorController - - - AuthorController - /AuthorController - - - AdministratorController - com.javaBeans.AdministorController - - - AdministratorController - /AdministratorController - - - UploadServlet - com.javaBeans.UploadServlet - - - UploadServlet - /UploadServlet - - - DownloadServlet - com.javaBeans.DownloadServlet - - - DownloadServlet - /DownloadServlet - - - - CharacterEncodingFilter - org.springframework.web.filter.CharacterEncodingFilter - - encoding - UTF-8 - - - - CharacterEncodingFilter - /* - - - diff --git a/src/main/webapp/index.jsp b/src/main/webapp/index.jsp deleted file mode 100644 index 325f7e4..0000000 --- a/src/main/webapp/index.jsp +++ /dev/null @@ -1,206 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> - - - - - -Home - - - - - - -
- -
- - - - - select * from subject where parentsid=0 - - -
-
-
-
- - <%----%> - <%--select * from article a , subject s where a.sid=s.sid and subject="${s_row.subject}" and hide="No";--%> - <%-- --%> - - select * from subject where parentsid=${s_row.sid}; - - - - -
- -
- - select * from article a , subject s where a.sid=s.sid and subject="${row.subject}" and hide="No"; - - -
-
-
-
-<%--Computer Science--%> -<%----%> -<%--
--%> -<%--
--%> - -<%--Medical Science--%> -<%----%> -<%--
--%> -<%--
--%> - - -<%--Social Science--%> -<%----%> -<%--
--%> -<%--
--%> - -<%--Biological Science--%> -<%----%> -<%--
--%> -<%--
--%> - -<%--Mathematics--%> -<%----%> -<%--
--%> -<%--
--%> - -
-
-
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/src/main/webapp/success.jsp b/src/main/webapp/success.jsp deleted file mode 100644 index 8cd981d..0000000 --- a/src/main/webapp/success.jsp +++ /dev/null @@ -1,24 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> - - - - -Insert title here - - - - - - - - - - - -">download -<%--">list--%> - - - \ No newline at end of file diff --git a/target/WZF_OAPS.war b/target/WZF_OAPS.war deleted file mode 100644 index b96bb7e..0000000 Binary files a/target/WZF_OAPS.war and /dev/null differ diff --git a/target/WZF_OAPS/Aboutus.jsp b/target/WZF_OAPS/Aboutus.jsp deleted file mode 100644 index 4b68ece..0000000 --- a/target/WZF_OAPS/Aboutus.jsp +++ /dev/null @@ -1,139 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -About us - - - - - - -
- -
-
团队成员:吴钟富,唐震,卓晨曦,庄梓淇
-
- 2020 copyright©Wu Zhongfu -
- - - diff --git a/target/WZF_OAPS/AddSubject.jsp b/target/WZF_OAPS/AddSubject.jsp deleted file mode 100644 index b2bddd2..0000000 --- a/target/WZF_OAPS/AddSubject.jsp +++ /dev/null @@ -1,99 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> - - - - - Insert title here - - - - - - - -
-

Welcome Administrator

- -
- - -

${info}

-
- - - - - - - - - - - - - -
- -
- -<%----%> - -
- 2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/Administrator.jsp b/target/WZF_OAPS/Administrator.jsp deleted file mode 100644 index b47e811..0000000 --- a/target/WZF_OAPS/Administrator.jsp +++ /dev/null @@ -1,172 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> - - - - - - - Admin - - - - - - -
- -
- - -
- - - - - - - - -

Admin Login

Apply for administrator account
-
-

${advice}

- - -
- 2020 copyright©Wu Zhongfu -
- - - diff --git a/target/WZF_OAPS/AdministratorEdit.jsp b/target/WZF_OAPS/AdministratorEdit.jsp deleted file mode 100644 index 4214946..0000000 --- a/target/WZF_OAPS/AdministratorEdit.jsp +++ /dev/null @@ -1,122 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> - - - - - Insert title here - - - - - - - -
-

Welcome Administrator

- -
- - - -<%----%> -<%----%> - <%--select * from subject where subject='<%= request.getAttribute("subject")%>'--%> -<%----%> - -<%----%> - -

${info}

-
- - "> - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current Subject Name
" readonly style="background:lightgray">
New Subject Name
- -
- -<%--
--%> - -
- 2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/AdministratorHome.jsp b/target/WZF_OAPS/AdministratorHome.jsp deleted file mode 100644 index afb4480..0000000 --- a/target/WZF_OAPS/AdministratorHome.jsp +++ /dev/null @@ -1,131 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> - - - - - - Author Home - - - - - - - - - select * from subject order by parentsid - - -
-

Admin Subject

- -
- - - -
- - - - - - - - - - - - - - - - - - - -
SubjectIdNameParentIdLastModificationTime
edit || - delete - - || - AddChildSubject - - -
-
- -
- 2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/Articles.jsp b/target/WZF_OAPS/Articles.jsp deleted file mode 100644 index eeac7cd..0000000 --- a/target/WZF_OAPS/Articles.jsp +++ /dev/null @@ -1,174 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - -Articles - - - - - - -
- -
- - - - -select * from article a , subject s where a.sid=s.sid and hide="No" - - -
- - - - - - - - - - - - - - - -
TitleAuthorTimePopularity
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/AuthorArticle.jsp b/target/WZF_OAPS/AuthorArticle.jsp deleted file mode 100644 index 288ecd8..0000000 --- a/target/WZF_OAPS/AuthorArticle.jsp +++ /dev/null @@ -1,179 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - -Author Article - - - - - - -
- -
- - - - -select * from article a , subject s where a.sid=s.sid and author = '${ author}' - - -
- - - - - - - - - - - - - - - - - - -
AuthorSubjectTitleTimePopularity
Download
-
- - -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/AuthorEdit.jsp b/target/WZF_OAPS/AuthorEdit.jsp deleted file mode 100644 index 57ce0ea..0000000 --- a/target/WZF_OAPS/AuthorEdit.jsp +++ /dev/null @@ -1,134 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql" %> - - - - - Insert title here - - - - - - - -
-

Welcome Author

- -
- - - - - - select * from article a , subject s where a.sid=s.sid and title='<%= request.getAttribute("title")%>' - - - - -

${info}

-
- - "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Current Subject
" readonly style="background:lightgray">
Title
" placeholder="Enter title" required>
Highlights
" placeholder="Enter highlights" required>
Abstract
" placeholder="Enter abstract" required>
-
- -
- -
- 2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/AuthorHome.jsp b/target/WZF_OAPS/AuthorHome.jsp deleted file mode 100644 index 060dd34..0000000 --- a/target/WZF_OAPS/AuthorHome.jsp +++ /dev/null @@ -1,124 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> - - - - - -Author Home - - - - - - - - - select * from article a , subject s where a.sid=s.sid - -
-

Admin Article

- -
- - - -
- - - - - - - - - - - - - - - - - -
SubjectTitleHighlightHideOption
edit || - delete|| - show|| - hide -
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/Comments.jsp b/target/WZF_OAPS/Comments.jsp deleted file mode 100644 index f53686a..0000000 --- a/target/WZF_OAPS/Comments.jsp +++ /dev/null @@ -1,177 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - - -Comments - - - - - - -
- -
- - - - -select * from comments - - -
- - - - - - - - - - - - - - - -
TitleUserCommentTime
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/META-INF/MANIFEST.MF b/target/WZF_OAPS/META-INF/MANIFEST.MF deleted file mode 100644 index e562287..0000000 --- a/target/WZF_OAPS/META-INF/MANIFEST.MF +++ /dev/null @@ -1,5 +0,0 @@ -Manifest-Version: 1.0 -Built-By: AAA -Created-By: IntelliJ IDEA -Build-Jdk: 1.8.0_131 - diff --git a/target/WZF_OAPS/MasterArticles.jsp b/target/WZF_OAPS/MasterArticles.jsp deleted file mode 100644 index f4cb794..0000000 --- a/target/WZF_OAPS/MasterArticles.jsp +++ /dev/null @@ -1,125 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - - -Master Articles - - - - - - - -
-

Welcome Author

- -
- - - - -select * from article a,subject s where a.sid=c.sid - - -
- - - - - - - - - - - - - - - -
TitleAuthorTimeOption
delete
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/MasterComments.jsp b/target/WZF_OAPS/MasterComments.jsp deleted file mode 100644 index 6351b7a..0000000 --- a/target/WZF_OAPS/MasterComments.jsp +++ /dev/null @@ -1,64 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> - - - - -Master Comments - - - - - - - -
-

Welcome Author

- -
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/MasterViewArticle.jsp b/target/WZF_OAPS/MasterViewArticle.jsp deleted file mode 100644 index 39056a7..0000000 --- a/target/WZF_OAPS/MasterViewArticle.jsp +++ /dev/null @@ -1,130 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - - -Master View Article - - - - - - - -
-

Welcome Author

- -
- - - - -select * from article a , subject s where a.sid=s.sid and title="${ title}"; - - -
- - - - - - - - - - - - - - - - - -

Abstract
Highlight
Publication Date
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/NewFile.jsp b/target/WZF_OAPS/NewFile.jsp deleted file mode 100644 index 01e5dfc..0000000 --- a/target/WZF_OAPS/NewFile.jsp +++ /dev/null @@ -1,221 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - -NewFile - - - - - - -
- -
- -
- - - - - - -

You are in

-
- - - - -select * from article a , subject s where a.sid=s.sid and subject='<%=request.getAttribute("subject") %>' and hide="No" - - -
- - - - - - - - - - - - - - - - -
TitleAuthorTimePopularity
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/PostArticle.jsp b/target/WZF_OAPS/PostArticle.jsp deleted file mode 100644 index 1c14147..0000000 --- a/target/WZF_OAPS/PostArticle.jsp +++ /dev/null @@ -1,192 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> - - - - -Post Articles - - - - - - -
- -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

${suggestion}

Author's email
" readonly style="background:lightgray">
Current Subject
" readonly style="background:lightgray">
Title
Highlights
Abstract
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/Search.jsp b/target/WZF_OAPS/Search.jsp deleted file mode 100644 index fb5e49f..0000000 --- a/target/WZF_OAPS/Search.jsp +++ /dev/null @@ -1,217 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> - - - - - -Search - - - - - - -
- -
- - - - -select * from article a , subject s where a.sid=s.sid and hide="No" and (title like '%<%=request.getAttribute("search2") %>%' or abstracts like '%<%=request.getAttribute("search2") %>%' or highlight like '%<%=request.getAttribute("search2") %>%') order by time desc - - -
- - - - - - - - - - - - - - - - - - -
SubjectTitleAuthor EmailTimePopularity
-
- -

- - - -select * from comments where comment like '%<%=request.getAttribute("search2") %>%' order by time desc - - - -
- - - - - - - - - - - - - - - - - - - -
TitleCommentTimeAuthor
-
- - -
-Copyright (C) 2019, 2020 [MIJC Team] -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/WEB-INF/classes/com/database/DB.class b/target/WZF_OAPS/WEB-INF/classes/com/database/DB.class deleted file mode 100644 index e88e1e3..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/database/DB.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/filter/Filter_AdminLogin.class b/target/WZF_OAPS/WEB-INF/classes/com/filter/Filter_AdminLogin.class deleted file mode 100644 index 7896c5d..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/filter/Filter_AdminLogin.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Administrator.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Administrator.class deleted file mode 100644 index 60b84cf..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Administrator.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Article.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Article.class deleted file mode 100644 index 4d61b9b..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Article.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Author.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Author.class deleted file mode 100644 index 339010b..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Author.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Subject.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Subject.class deleted file mode 100644 index 6ffed53..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBean/Subject.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/AdministorController.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/AdministorController.class deleted file mode 100644 index fa46d4f..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/AdministorController.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/AuthorController.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/AuthorController.class deleted file mode 100644 index 6a2aa01..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/AuthorController.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/Controller.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/Controller.class deleted file mode 100644 index 34d4385..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/Controller.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/DownloadServlet.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/DownloadServlet.class deleted file mode 100644 index fa6d4a4..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/DownloadServlet.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/UploadServlet.class b/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/UploadServlet.class deleted file mode 100644 index 4d6fbae..0000000 Binary files a/target/WZF_OAPS/WEB-INF/classes/com/javaBeans/UploadServlet.class and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/javax.servlet-api-3.1.0.jar b/target/WZF_OAPS/WEB-INF/lib/javax.servlet-api-3.1.0.jar deleted file mode 100644 index 6b14c3d..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/javax.servlet-api-3.1.0.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/mysql-connector-java-5.1.32.jar b/target/WZF_OAPS/WEB-INF/lib/mysql-connector-java-5.1.32.jar deleted file mode 100644 index f82dd98..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/mysql-connector-java-5.1.32.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/spring-aop-5.0.5.RELEASE.jar b/target/WZF_OAPS/WEB-INF/lib/spring-aop-5.0.5.RELEASE.jar deleted file mode 100644 index 74f8d71..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/spring-aop-5.0.5.RELEASE.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/spring-beans-5.0.5.RELEASE.jar b/target/WZF_OAPS/WEB-INF/lib/spring-beans-5.0.5.RELEASE.jar deleted file mode 100644 index 7720693..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/spring-beans-5.0.5.RELEASE.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/spring-context-5.0.5.RELEASE.jar b/target/WZF_OAPS/WEB-INF/lib/spring-context-5.0.5.RELEASE.jar deleted file mode 100644 index 9e846d4..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/spring-context-5.0.5.RELEASE.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/spring-core-5.0.5.RELEASE.jar b/target/WZF_OAPS/WEB-INF/lib/spring-core-5.0.5.RELEASE.jar deleted file mode 100644 index 016a47b..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/spring-core-5.0.5.RELEASE.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/spring-expression-5.0.5.RELEASE.jar b/target/WZF_OAPS/WEB-INF/lib/spring-expression-5.0.5.RELEASE.jar deleted file mode 100644 index 80a30f6..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/spring-expression-5.0.5.RELEASE.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/spring-jcl-5.0.5.RELEASE.jar b/target/WZF_OAPS/WEB-INF/lib/spring-jcl-5.0.5.RELEASE.jar deleted file mode 100644 index c04f8ff..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/spring-jcl-5.0.5.RELEASE.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/lib/spring-web-5.0.5.RELEASE.jar b/target/WZF_OAPS/WEB-INF/lib/spring-web-5.0.5.RELEASE.jar deleted file mode 100644 index 8233049..0000000 Binary files a/target/WZF_OAPS/WEB-INF/lib/spring-web-5.0.5.RELEASE.jar and /dev/null differ diff --git a/target/WZF_OAPS/WEB-INF/web.xml b/target/WZF_OAPS/WEB-INF/web.xml deleted file mode 100644 index be876ea..0000000 --- a/target/WZF_OAPS/WEB-INF/web.xml +++ /dev/null @@ -1,72 +0,0 @@ - - - - OOAD - - index.html - index.htm - index.jsp - default.html - default.htm - default.jsp - - - Controller - com.javaBeans.Controller - - - Controller - /Controller - - - AuthorController - com.javaBeans.AuthorController - - - AuthorController - /AuthorController - - - AdministratorController - com.javaBeans.AdministorController - - - AdministratorController - /AdministratorController - - - UploadServlet - com.javaBeans.UploadServlet - - - UploadServlet - /UploadServlet - - - DownloadServlet - com.javaBeans.DownloadServlet - - - DownloadServlet - /DownloadServlet - - - - CharacterEncodingFilter - org.springframework.web.filter.CharacterEncodingFilter - - encoding - UTF-8 - - - - CharacterEncodingFilter - /* - - - diff --git a/target/WZF_OAPS/blocklist.jsp b/target/WZF_OAPS/blocklist.jsp deleted file mode 100644 index 19fafd8..0000000 --- a/target/WZF_OAPS/blocklist.jsp +++ /dev/null @@ -1,123 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> - - - - - -Master Author - - - - - - - -
-

Block List

- -
- - - - -select email from block_author; - - -
- - - - - - - - - - - - -
AuthorOption
release
-
- -
-2020 copyright©Wu Zhongfu -
- - - \ No newline at end of file diff --git a/target/WZF_OAPS/index.jsp b/target/WZF_OAPS/index.jsp deleted file mode 100644 index 325f7e4..0000000 --- a/target/WZF_OAPS/index.jsp +++ /dev/null @@ -1,206 +0,0 @@ -<%@ page language="java" contentType="text/html; charset=UTF-8" - pageEncoding="UTF-8"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> -<%@ taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%> - - - - - -Home - - - - - - -
- -
- - - - - select * from subject where parentsid=0 - - -
-
-
-
- - <%----%> - <%--select * from article a , subject s where a.sid=s.sid and subject="${s_row.subject}" and hide="No";--%> - <%-- --%> - - select * from subject where parentsid=${s_row.sid}; - - - - -
- -
- - select * from article a , subject s where a.sid=s.sid and subject="${row.subject}" and hide="No"; - - -
-
-
-
-<%--Computer Science--%> -<%----%> -<%--
--%> -<%--
--%> - -<%--Medical Science--%> -<%----%> -<%--
--%> -<%--
--%> - - -<%--Social Science--%> -<%----%> -<%--
--%> -<%--
--%> - -<%--Biological Science--%> -<%----%> -<%--
--%> -<%--
--%> - -<%--Mathematics--%> -<%----%> -<%--
--%> -<%--
--%> - -
-
-
-
- - - - - \ No newline at end of file diff --git "a/target/WZF_OAPS/resources/Python\350\257\255\350\250\200\347\250\213\345\272\217\350\256\276\350\256\241 .pdf" "b/target/WZF_OAPS/resources/Python\350\257\255\350\250\200\347\250\213\345\272\217\350\256\276\350\256\241 .pdf" deleted file mode 100644 index 433af7e..0000000 Binary files "a/target/WZF_OAPS/resources/Python\350\257\255\350\250\200\347\250\213\345\272\217\350\256\276\350\256\241 .pdf" and /dev/null differ diff --git a/target/WZF_OAPS/resources/kong.pdf b/target/WZF_OAPS/resources/kong.pdf deleted file mode 100644 index e69de29..0000000 diff --git "a/target/WZF_OAPS/resources/\347\254\254\344\272\224\347\253\240\357\274\232\345\276\252\347\216\257.pdf" "b/target/WZF_OAPS/resources/\347\254\254\344\272\224\347\253\240\357\274\232\345\276\252\347\216\257.pdf" deleted file mode 100644 index 93395b7..0000000 Binary files "a/target/WZF_OAPS/resources/\347\254\254\344\272\224\347\253\240\357\274\232\345\276\252\347\216\257.pdf" and /dev/null differ diff --git a/target/WZF_OAPS/style.css b/target/WZF_OAPS/style.css deleted file mode 100644 index 4fb8481..0000000 --- a/target/WZF_OAPS/style.css +++ /dev/null @@ -1,69 +0,0 @@ -@charset "UTF-8"; - -body -{ - margin:0px; -} - -header -{ - background-color:blue; - text-align:center; - height:70px; - margin-bottom:50px; -} - -header nav -{ - padding-top:20px; -} - -header a -{ - font-size:25px; - margin-left:25px; - text-decoration:none; - color:white; - cursor:default; -} - -header a:hover -{ - color:gold; -} - -header form -{ - display:inline-block; -} - -header select -{ - margin-left:25px; - font-size:25px; - border-radius:3px 3px 3px 3px; -} - -header button -{ - font-size:20px; - border-radius:5px 5px 5px 5px; -} - -header input -{ - margin-left:25px; - font-size:20px; - border-radius:3px 3px 3px 3px; -} - -footer -{ - background:black; - height:40px; - color:white; - text-align:center; - padding:5px; - font-size:20px; - margin-top:50px; -} diff --git a/target/classes/com/database/DB.class b/target/classes/com/database/DB.class deleted file mode 100644 index e88e1e3..0000000 Binary files a/target/classes/com/database/DB.class and /dev/null differ diff --git a/target/classes/com/filter/Filter_AdminLogin.class b/target/classes/com/filter/Filter_AdminLogin.class deleted file mode 100644 index 7896c5d..0000000 Binary files a/target/classes/com/filter/Filter_AdminLogin.class and /dev/null differ diff --git a/target/classes/com/javaBean/Administrator.class b/target/classes/com/javaBean/Administrator.class deleted file mode 100644 index 60b84cf..0000000 Binary files a/target/classes/com/javaBean/Administrator.class and /dev/null differ diff --git a/target/classes/com/javaBean/Article.class b/target/classes/com/javaBean/Article.class deleted file mode 100644 index 4d61b9b..0000000 Binary files a/target/classes/com/javaBean/Article.class and /dev/null differ diff --git a/target/classes/com/javaBean/Author.class b/target/classes/com/javaBean/Author.class deleted file mode 100644 index 4613e37..0000000 Binary files a/target/classes/com/javaBean/Author.class and /dev/null differ diff --git a/target/classes/com/javaBean/Subject.class b/target/classes/com/javaBean/Subject.class deleted file mode 100644 index 6ffed53..0000000 Binary files a/target/classes/com/javaBean/Subject.class and /dev/null differ diff --git a/target/classes/com/javaBeans/AdministorController.class b/target/classes/com/javaBeans/AdministorController.class deleted file mode 100644 index b52da27..0000000 Binary files a/target/classes/com/javaBeans/AdministorController.class and /dev/null differ diff --git a/target/classes/com/javaBeans/AuthorController.class b/target/classes/com/javaBeans/AuthorController.class deleted file mode 100644 index 6a2aa01..0000000 Binary files a/target/classes/com/javaBeans/AuthorController.class and /dev/null differ diff --git a/target/classes/com/javaBeans/Controller.class b/target/classes/com/javaBeans/Controller.class deleted file mode 100644 index 34d4385..0000000 Binary files a/target/classes/com/javaBeans/Controller.class and /dev/null differ diff --git a/target/classes/com/javaBeans/DownloadServlet.class b/target/classes/com/javaBeans/DownloadServlet.class deleted file mode 100644 index fa6d4a4..0000000 Binary files a/target/classes/com/javaBeans/DownloadServlet.class and /dev/null differ diff --git a/target/classes/com/javaBeans/UploadServlet.class b/target/classes/com/javaBeans/UploadServlet.class deleted file mode 100644 index 4d6fbae..0000000 Binary files a/target/classes/com/javaBeans/UploadServlet.class and /dev/null differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties deleted file mode 100644 index 1eca2f9..0000000 --- a/target/maven-archiver/pom.properties +++ /dev/null @@ -1,4 +0,0 @@ -#Created by Apache Maven 3.5.2 -version=1.0-SNAPSHOT -groupId=zjnu -artifactId=WZF_OAPS diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst deleted file mode 100644 index e69de29..0000000 diff --git a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst b/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst deleted file mode 100644 index 955db95..0000000 --- a/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst +++ /dev/null @@ -1,11 +0,0 @@ -E:\javawproject\WZF_OAPS\src\main\java\com\database\DB.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBeans\AuthorController.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBeans\AdministorController.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBean\Administrator.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBeans\UploadServlet.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBean\Subject.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBeans\Controller.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBean\Article.java -E:\javawproject\WZF_OAPS\src\main\java\com\filter\Filter_AdminLogin.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBean\Author.java -E:\javawproject\WZF_OAPS\src\main\java\com\javaBeans\DownloadServlet.java diff --git "a/\351\241\271\347\233\256\345\267\262\347\273\217\344\270\212\344\274\240\345\210\260\350\277\231\344\270\252\347\275\221\345\235\200.txt" "b/\351\241\271\347\233\256\345\267\262\347\273\217\344\270\212\344\274\240\345\210\260\350\277\231\344\270\252\347\275\221\345\235\200.txt" deleted file mode 100644 index 2624c19..0000000 --- "a/\351\241\271\347\233\256\345\267\262\347\273\217\344\270\212\344\274\240\345\210\260\350\277\231\344\270\252\347\275\221\345\235\200.txt" +++ /dev/null @@ -1 +0,0 @@ -http://47.115.56.157:8080/wzf/ \ No newline at end of file