一個簡單的Java Web項目,使用JSP、Servlet、MySQL、Bootstarp等技術實現。完成了註冊登錄,發布博客、閱讀博客、點贊、發布評論、個人資料更改、自適應電腦手機等功能。如果您喜歡,請點擊星星,謝謝。
A simple Java Web project, use JSP, Servlet, MySql, Bootstarp and others. Realized the function of login and register, publish blog, read blog, show like, publish comment, person profile change,adaptive desktop mobile and others.If you like this, please click the star, thanks.
首頁有一個簡單的介紹面板,然後下面是博文推薦,隨機推薦10篇博文。

登錄,需要輸入驗證碼,驗證碼為一個簡單的算式,可以記住賬號密碼。登錄後跳轉回登錄前的位置,並且部分編輯數據能被保存(不由登錄組件實現)。

註冊。

上面顯示標題和時間(包括文章是否修改,修改時間),右邊有操作按鈕,可以對文章進行編輯或者刪除操作。中間有作者信息、文章數據統計和表態按鈕,可以點贊、取消點贊、反對、取消反對(反對不會被統計,但是會被記錄)等操作。下面是評論區,可以發表評論,查看評論,評論使用Ajax動態加載,每次加載10條評論。

文章評論採用動態分頁加載策略,每次加載10條。刪除彈窗與回复彈窗類似,回复刪除都是採用Ajax技術,不需要刷新整個頁面(除了在上面發表評論)。評論的管理由評論者本人、網站管理員和文章作者共同管理。

博客頁面顯示本站所有用戶的博客,可以按照點贊量、評論量、瀏覽量、發表時間和修改時間等進行排序,使用分頁技術,每頁10條數據(如下頁腳)。

支持關鍵詞搜索,能搜索標題、內容和用戶,分頁技術與博客頁面一致。

使用summernote-v0.8.20實現富文本編輯,實現了圖片上傳,因為是存數據庫中的,所以最長6w的代碼文本長度(後面可改進以文件形式存放或者其他方案),發表博文使用Ajax技術。

個人資料頁面,有個人的數據統計,個人資料和個人博文列表(分頁)。

編輯資料頁面,可以編輯頭像(預製)、暱稱、簽名、性別、家鄉和聯繫方式等個人資料。

簡單的修改密碼界面。


未讀消息是黑色、填充的,消息顯示後變成灰色、去填充的。

消息附帶鏈接,點擊消息到達指定文章的指定位置。
管理主頁,顯示一些本站的統計數據。

用戶管理界面。

博客管理界面。

評論管理界面。

公告發布界面,可篩選發送對象,設置點擊後跳轉位置,發送後以消息的形式通知到指定用戶。

編輯數據界面,編輯框框是動態生成的,不是寫好的,修改後能跳回原來進入修改的位置。

手機界面與電腦共用一個頁面,採用響應式前端框架Bootstrap實現。

手機端界面與電腦端區別不大,有的地方為了適應手機的操作,重新做了排版,比如閱讀頁面中部部分。

手機端的發布博文界面不太好操作,但是依然能使用。

在手機端看來貌似電腦的佈局大了許多。

管理界面沒用任何的框架,依然是如此地齣戲QwQ ~。

總體上看功能相對簡單,但是個人感覺界面是挺精緻的(除了管理界面)。
所有賬號的密碼都為(The password of all accounts is ) 123456 !
數據庫配置文件(SQL config file):src/druid.properties
數據庫結構文件(SQL structure file):src/xiaoxiang_blog.sql
數據庫測試數據文件(SQL data file):src/xiaoxiang_blog_data.sql
測試數據文件裡面內置了一些文章、評論、測試賬號等(文章版權歸原作者,摘抄時並未進行任何溝通)用於測試。 Some articles, comments, test accounts, etc. are built in the test data file (the copyright of the article belongs to the original author, and no communication is made during the extraction) for testing.
管理員註冊配置文件(admin config file):src/admin.properties
管理員採用註冊的形式,在配置文件文件中寫好管理員的賬號,然後去註冊頁面註冊,註冊後就是管理員。或者也可以直接修改數據庫,把role字段改為1。 The administrator uses the form of registration, writes the administrator's account in the configuration file, and then goes to the registration page to register. After registration, the administrator is the administrator. Or you can directly modify the database and change the role field to 1.
日誌配置文件(log config file):src/logback.xml
Debug模式配置文件(debug mode config file):src/minuhy/xiaoxiang/blog/config/DebugConfig.java
日誌處理詳情請看配置文件。 See the configuration file for log processing details.
可刪除的HTML測試文件夾(Removable HTML test folder):WebContent/html
裡面是編寫前端時的代碼,刪除完全不影響正常使用。 It contains the code when writing the front end. Deleting it does not affect normal use at all.
預製圖片文件夾(Prefabricated picture folder):WebContent/img
內置一些系統需要用到的圖標等。 Built-in some icons needed by the system.
預製頭像文件夾(Prefabricated avatar folder):WebContent/img/avatar
h001.png到h138.png都是從QQ安卓版安裝包中提取出來的頭像圖片文件,版權解釋歸QQ所有,本項目僅用於測試。 Both h001.png and h138.png are avatar image files extracted from the QQ Android installation package. The copyright interpretation belongs to QQ. This project is only used for testing.
HTML庫文件夾(HTML Library Folder):WebContent/lib
所有庫採用下載的形式加入到項目中,庫中的代碼版權歸原作者所有。 All libraries are added to the project in the form of download, and the code copyright in the library belongs to the original author.
HTML css js 文件夾(Folder):WebContent/lib/xiaoxiang
自己寫的js和css存放在此。 My js and css file in this.
JSP公共組件(common page):WebContent/partial
包括頁頭、頁腳、導航欄等。 Include page head,page foot and nav.
JSP管理員組件(admin page):WebContent/admin
管理員頁面的所有JSP文件。 All admin page in this.
commons-fileupload-1.5 https://commons.apache.org/proper/commons-fileupload/
commons-io-2.11.0 https://commons.apache.org/proper/commons-io/
druid-1.2.16 https://github.com/alibaba/druid
fastjson-1.2.83 https://github.com/alibaba/fastjson
mysql-connector-java-5.1.49 https://dev.mysql.com/blog-archive/mysql-connector-j-5-1-49-ga-has-been-released/
logback-classic-1.2.11 https://logback.qos.ch/download.html
logback-core-1.2.11 https://logback.qos.ch/download.html
slf4j-api-1.7.36 https://www.slf4j.org/download.html
bootstrap-3.4.1 https://getbootstrap.com/docs/3.4/
doT-1.1.3 https://github.com/olado/doT
html5shiv-3.7.3 https://github.com/aFarkas/html5shiv
jquery-1.12.4 https://jquery.com/
respond.js-1.4.2 https://github.com/scottjehl/Respond
summernote-v0.8.20 https://summernote.org/