【正文】
表 管理類列表 管理類 說明 BlogMgr類 完成對博客管理員表的查詢、更新及統(tǒng)計 Article類 完成對日志表的查詢、更新及統(tǒng)計 FeedBack 類 完成對評論表的查詢、更新及統(tǒng)計 Message類 完成對留言表的查詢、更新及統(tǒng)計 FeedbackMgr 類的部分代碼如下: public class FeedbackMgr { /* * 添加評論 */ public void add(Feedback feedback){ DBConnect dbc = null。 博客信息管理系統(tǒng)所用的 JavaBean 類列表如表 所示。 } // 執(zhí)行 SQL語句并返回字段集 public ResultSet executeQuery() throws SQLException { if (prepstmt != null) { return ()。 公共核心類的設(shè)計 數(shù)據(jù)庫相關(guān) 訪問數(shù)據(jù)庫相關(guān)類如下: ( 1)獲取 數(shù)據(jù)源,其代碼如下: public static Connection getConnection(){ try { 創(chuàng)業(yè)創(chuàng)新 知識管 理 Ahead Institute of Software and Technology 27 Context ctx = (Context)new InitialContext().lookup()。在頁面的上方是博客信息管理系統(tǒng)的導航列表,圖中顯示的導航 條包括登錄、注冊、博客列表、博文全覽以及站務公告。如果數(shù)據(jù)庫連接池對象中沒有空閑的連接,且連接數(shù)沒有達到最大(即:最大活躍連接數(shù)),創(chuàng)建一個新的數(shù)據(jù)庫連接。 本系統(tǒng)具體的數(shù)據(jù)表之間關(guān)系圖如圖 所示: 創(chuàng)業(yè)創(chuàng)新 知識管 理 Ahead Institute of Software and Technology 23 圖 數(shù)據(jù)表之間關(guān)系圖 數(shù)據(jù)連接 目前流行的數(shù)據(jù)庫連接技術(shù)主要有: JDBCODBC 橋、 JDBC 和數(shù)據(jù)連接 池技術(shù)。 表 日志表 列名 含義 類型 長度 缺省值 允許空 ArticleID 日志編號 Int 4 無 否 Title 日志標題 Varchar 50 無 否 Content 日志內(nèi)容 text 8 無 否 CategoryID 類別 ID int 4 無 否 PublishTime 日志發(fā)表時間 Datetime 8 無 否 LastModifyTime 日志最后修改時間 Datetime 8 無 否 BlogID 用戶 ID Int 4 無 否 ReadTimes 日志瀏覽次數(shù) Int 4 0 否 創(chuàng)業(yè)創(chuàng)新 知識管 理 Ahead Institute of Software and Technology 21 FeedBackNum 日志評論數(shù) Int 4 0 否 ( 3)日志評論表,此表主要用于保存日志評論的基本信息。 創(chuàng)業(yè)創(chuàng)新 知識管 理 Ahead Institute of Software and Technology 18 博客管理員ID用戶名密碼主題E mail說明發(fā)表日志數(shù)注冊日期 圖 用戶 ER圖 日志類別 ER 圖如圖 所示。 ER 模型中包含“實體”,“聯(lián)系”和“屬性”。 ( 2)數(shù)據(jù)查詢優(yōu)化與索引的建立。 在該模塊中還提供了博客頁面統(tǒng)計信息, 日志、評論及留言信息分頁顯示等方便用戶的顯示效果。在客戶選擇了某個博客或者某個感興趣的日志后,可以方便地跳轉(zhuǎn)到對應博客頁面進行日志的閱讀,并和博客進行交 創(chuàng)業(yè)創(chuàng)新 知識管 理 Ahead Institute of Software and Technology 16 流互動。注冊成功的博客登錄時,會隨時根據(jù)博客輸入的登錄信息進行提示,如用戶名錯誤或者密碼錯誤。 該功能模塊實現(xiàn)了以下幾個子功能。若未通過驗證,則顯示出錯提示,并跳轉(zhuǎn)到登錄界面。 創(chuàng)業(yè)創(chuàng)新 知識管 理 Ahead Institute of Software and Technology 11 提交事物事物處理程序存儲文件博客展示系統(tǒng)顯示結(jié)果 圖 用戶查詢?nèi)罩镜臄?shù)據(jù)流程圖 用戶查詢?nèi)罩镜臄?shù)據(jù)流程:首先,用戶輸入需查找的關(guān)鍵字,然后提交表單數(shù)據(jù),服務器接收到 關(guān)鍵字后,根據(jù)關(guān)鍵字對日志標題進行模糊查詢,處理后將結(jié)果以日志標題鏈接的形式顯示給該用戶,用戶點擊相應的鏈接就可以瀏覽日志內(nèi)容。 ( 2)用例:代表系統(tǒng)可以實現(xiàn)的功能,通常一個用例代表一組功能,實質(zhì)上規(guī)定了系統(tǒng)實現(xiàn)功能的范圍。訪問模型的數(shù)據(jù),并且當模型的數(shù)據(jù)發(fā)生變化時更新模型的顯示。 MVC 設(shè)計模式 MVC 模式的基本形式圖如圖 所示。因此需要一個交互式的 Web,于是便誕生了各種 Web 語言。 在此種開發(fā)模式中, JSP 技術(shù)用來顯示頁面,該頁面中沒有任何的商業(yè)處理邏輯,通過 Servlet 技術(shù)來完成大量的事物處理工作。 JSP 網(wǎng)站開發(fā)技術(shù)標準提供了兩種開發(fā)模式:一種是 JSP+JavaBean 開發(fā)模式;一種是 JSP+Servlet+JavaBean 開發(fā)模式 [8,9]。用戶通過瀏覽器向服務器發(fā)送請求, Web 服務器接收客戶端發(fā)送來的請求,對請求進行分析, 如果請求是靜態(tài)頁面,那么就將所請求的頁面發(fā)送到客戶端;如果請求的是動態(tài)頁面,那么就執(zhí)行此動態(tài)頁面,并將執(zhí)行結(jié)果發(fā)送給客戶端。 JavaBean 在 JSP 程序中常用來封裝事務邏輯、數(shù)據(jù)庫操作等,可以很好的實現(xiàn)業(yè)務邏輯和前臺程序的分離,使得系統(tǒng)具有更好的健壯性和靈活性。按照 Sun 公司的定 義, JavaBean 是一個可重復使用的軟件部件。 Servlet 的主要功能在于交互式地瀏覽和修改數(shù)據(jù),生成動態(tài) Web 內(nèi)容。 JSP 充分利用了 Java 的強大功能,是一種優(yōu)秀的服務器端技術(shù)。 ( 4)日志管理。 ( 5)交友,互相鼓勵,一路同行。雖然一些想法一些思考只是皮毛,沒有什么深度,但是當下筆去寫的時候每次都會對某個小小的問題有了更多的一點點思考,再寫博客的時候就感覺到了一種滿足感,一種想法得以釋放思考得以延伸的滿足感。以前在互聯(lián)網(wǎng)上的各種行為都是在 匿名狀態(tài)中,相互之間是不認識的,但有了博客之后可以天天關(guān)注,而別的人也可以通過博客找到這個人。 ( 2)按時間順序排列,而且是倒序方式,也就是最新的放在最上面,最舊的放在最下面。s static page separate with dynamic page mutually, using JSP+ JavaBean+ Servlet with the mode of development that the database of SQL Server2021 bine together. The paper discusses the background of development of the system and the design of the target first, and introduces the tecknique which used to develop the analyse of system, proceeded the simple analysis to the model of the system, made sure the operation process of the system, proceed the analyse to the system, ensure that under the current term, developing blog information management system is feasible. At the foundation of requirement with the analyse result, proceeding the providing of the function module of the system. Follow, designing the database model, including the data flow diagram, entity relation diagram and data tables. during the design and realization of the system, making sure the development thought of the system and install the environment of development,at last show the design details with realize finally an a key for of detailed design with realization, and analyzed the program which relate to the system module. After debugging and running ,it shows that the system can satisfy with users to create personal blog. Keywords: MVC,Design Patterns,Knowledge sharing,The Blog Information Management System 創(chuàng)業(yè)創(chuàng)新 知識管 理 Ahead Institute of Software and Technology VI 目 錄 第 1 章 緒論 .................................................................................................. 1 博客信息系統(tǒng)概述 ................................................................................................... 1 博客發(fā)展趨勢 ........................................................................................................... 2 系統(tǒng)開發(fā)的背景 ....................................................................................................... 2 技術(shù)路線 2 ................................................................................................................ 3 系統(tǒng)設(shè)計目標分析 ................................................................................................... 3 第 2 章 基本技術(shù)方案 .................................................................................. 4 JSP 中的各種技術(shù) .................................................................................................... 4 JSP 概述 ............................................................................................................ 4 SERVLET 概述 ....................................................................................................... 4 JAVABEAN 概述 ..................................................................................................... 5 基于 B/S 的 WEB 應用體系結(jié)構(gòu) ............................................................................... 5 傳統(tǒng)的兩層體系結(jié)構(gòu) ....................................................................................... 5 三層體系結(jié)構(gòu) .....................................