【正文】
st request, HttpServletResponse response) throws ServletException, IOException { (text/html。)。/script)。 String result = 文章添加失??!。 ArticleTypeForm ArticleTypeForm = new ArticleTypeForm()。/script)。 PrintWriter out = ()。=39。 } } public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response)。如圖45。如圖49。發(fā)表文章:進(jìn)入發(fā)表文章頁(yè)面,輸入標(biāo)題、文章內(nèi)容,點(diǎn)擊“發(fā)表文章”彈出發(fā)表成功提示,進(jìn)入日志頁(yè)面可以看到已發(fā)表的文章,單擊閱讀全文可以正常進(jìn)入全文瀏覽頁(yè)面。以上測(cè)試系統(tǒng)均可以正常通過(guò),完全可以達(dá)到預(yù)期的功能要求。提高了系統(tǒng)的可維護(hù)性以及運(yùn)行效率。 主要實(shí)現(xiàn)功能(1)實(shí)現(xiàn)了用戶(hù)的注冊(cè)、登錄、修改和刪除。Java技術(shù)相對(duì)于其它網(wǎng)站技術(shù)有著相當(dāng)大的優(yōu)勢(shì),如較高的運(yùn)行效率、安全性和擴(kuò)展性等。謹(jǐn)此對(duì)莊老師表示最衷心的感謝!同時(shí),我也要感謝學(xué)校提供給我這樣一次難得的實(shí)踐機(jī)會(huì),使我能夠在走出校門(mén)之前得到鍛煉,通過(guò)此次畢業(yè)設(shè)計(jì),必將對(duì)我的將來(lái)產(chǎn)生生積極的影響。它讓不同年齡和不同背景的人們能夠互動(dòng)起來(lái),在以后的日常生活中,它會(huì)作為人們生活的一部分,人們的情緒、智慧、意見(jiàn)和思想都將在這里表達(dá)。但同時(shí)也應(yīng)看到,由于時(shí)間倉(cāng)促系統(tǒng)的實(shí)現(xiàn)還不是盡善盡美,有待于進(jìn)一步的改進(jìn)和完善。 完成情況該系統(tǒng)具有JAVA技術(shù)所具有的許多優(yōu)良特性。在未成功登錄的情況下在IE地址欄直接輸入后臺(tái)頁(yè)面地址,返回錯(cuò)誤頁(yè)面,顯示“您還未登錄或登錄超時(shí),請(qǐng)單擊這里重新登錄!”的錯(cuò)誤信息。登錄:用正確的用戶(hù)名密碼登錄,可以成功登錄。如圖48。圖43 用戶(hù)登錄界面 Blog首頁(yè)考慮到日志是博客的主體部分,設(shè)計(jì)Blog首頁(yè)默認(rèn)顯示的是用戶(hù)的日志列表,右側(cè)是好友列表和最新公告,如圖44。(1)。添加文章類(lèi)別成功,請(qǐng)重新查詢(xún)!39。 } } // 后臺(tái)添加文章類(lèi)別 public void addArticleType(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { (text/html。=39。charset=GBK)。 (((phTime)))。)。 if ((刪除, articleForm)) { (script language=javascriptalert(39。(1)。修改文章成功,請(qǐng)重新查詢(xún)!39。 PrintWriter out = ()。/script)。 restoreDao = new RestoreDao()。 } else { (script language=javascriptalert(39。 (((reTitle)))。 } if (method == 7) { (request, response)。 public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { int method = ((method))。import 。import 。 return null。 return true。 (true)。public class JDBConnection {private final String url =jdbc:microsoft:sqlserver://localhost:1433。 } public void setPhTime(String phTime) { = phTime。 private Integer number=1。 } (增加, articleForm)。 try { while (()) { articleForm = new ArticleForm()。 ((6))。 order by id desc。 if ((sql)) { flag = true。,content=39。 + () + 39。 String sql = null。import 。表46 相片表列名數(shù)據(jù)類(lèi)型長(zhǎng)度Not Nullidint4photoAddressvarchar50√photoDescriptvarchar50√photoTimevarchar50√7)文章回復(fù)表,存放用戶(hù)的回復(fù)信息。經(jīng)過(guò)詳細(xì)的分析確定了系統(tǒng)的相關(guān)實(shí)體、實(shí)體的屬性以及各實(shí)體之間的關(guān)系,如圖41所示。設(shè)計(jì)數(shù)據(jù)庫(kù)系統(tǒng)時(shí)應(yīng)該首先充分了解用戶(hù)各個(gè)方面的要求,包括現(xiàn)有的以及將來(lái)可能增加的需求。 一個(gè)視圖(View)用來(lái)組織模型的內(nèi)容。用戶(hù)可以認(rèn)為JavaBean提供了一種隨時(shí)隨地的復(fù)制和粘貼的功能,而不用關(guān)心任何改變,因此,在Blog設(shè)計(jì)中使用JavaBean來(lái)封裝業(yè)務(wù)邏輯可以使程序邏輯更加清晰,提高開(kāi)發(fā)效率和質(zhì)量。從這一點(diǎn)來(lái)看,非常類(lèi)似Microsoft ASP、PHP等技術(shù)。J2EE包含Web、EJB以及Application Client,3部分。Java是一種簡(jiǎn)單的、面向?qū)ο蟮?、分布式的、解釋?zhí)行的、健壯的安全的、結(jié)構(gòu)的中立的、可移植的、性能很優(yōu)異的多線(xiàn)程的動(dòng)態(tài)的語(yǔ)言【1】。由于本Blog系統(tǒng)對(duì)硬件要求偏低,使用低端服務(wù)器或普通臺(tái)式計(jì)算機(jī)即可滿(mǎn)足基本需求。為提高數(shù)據(jù)庫(kù)安全性,為數(shù)據(jù)庫(kù)設(shè)定密碼,并禁用來(lái)賓用戶(hù)。但由于本Blog系統(tǒng)基于J2EE技術(shù),具有良好的可移植性,如果需要可以在不修改代碼的前提下由Windows平臺(tái)移植到UNIX或Linux平臺(tái)。已注冊(cè)的用戶(hù)即為會(huì)員,也即自己博客的博主。3)照片的上傳和管理:博主可以進(jìn)入相片管理頁(yè)面,上傳照片、編輯照片描述、刪除照片。 系統(tǒng)分析系統(tǒng)分析是管理開(kāi)發(fā)的起點(diǎn),也是整個(gè)管理系統(tǒng)實(shí)現(xiàn)過(guò)程中的關(guān)鍵環(huán)節(jié),因?yàn)槿绻到y(tǒng)環(huán)節(jié)做得不好,會(huì)影響到系統(tǒng)實(shí)現(xiàn)的后繼環(huán)節(jié),甚至造成開(kāi)發(fā)失敗。3)控制層(Controller)控制層主要用來(lái)轉(zhuǎn)發(fā)從視圖層傳來(lái)的數(shù)據(jù)和請(qǐng)求到相對(duì)應(yīng)的模型層,因此,實(shí)現(xiàn)它最好的方式莫過(guò)于使用Servlet了。(5)結(jié)論與致謝第2章 系統(tǒng)的總體設(shè)計(jì)框架 設(shè)計(jì)思想和設(shè)計(jì)原則 設(shè)計(jì)思想本系統(tǒng)分為前臺(tái)和后臺(tái)兩個(gè)部分,前臺(tái)包括日志、公告、好友、相冊(cè)、博主信息五個(gè)模塊,是呈現(xiàn)給會(huì)員和游客的頁(yè)面。Blog給大家看,大家的Blog也給你看。寫(xiě)B(tài)log,可以反映出人的思考過(guò)程,而不僅僅是思考結(jié)果。Blog作為一種新表達(dá)的方式,它傳播的不僅是情緒,包括大量的智慧、意見(jiàn)和思想。Blog用它的創(chuàng)新給網(wǎng)絡(luò)帶來(lái)了新的生命力,讓不同年齡層和不同背景的人們能夠互動(dòng)起來(lái)。它是應(yīng)時(shí)代的需求而興起的,也是應(yīng)時(shí)代需求不斷進(jìn)步的。Weblog,其實(shí)是Web和Log的組合詞。并且,目前基于J2EE的開(kāi)源框架也已經(jīng)非常成熟。JAVA作為目前最為流行的技術(shù)之一,其企業(yè)版本(J2EE)在設(shè)計(jì)與實(shí)現(xiàn)Web應(yīng)用方面非常適合。關(guān)鍵詞 :Blog;J2EE;Servlet;Java Bean;JSPAbstractWith the popularity of the network and the improvement of living conditions, people more and more dependent on the Internet, from work to the Internet to do more. Personal blog for them to build a network show and munication platform, where people can write log, mood, message, upload photos, post news, make friends, share their bits of life . Development of a blog system, through the activities of the rich and growing blog feature, so blog and being a part of life. JAVA technology as one of the most popular current, version of its enterprise (J2EE) Web applications in the design and implementation is very suitable. Moreover, the current open source J2EEbased framework has also been very mature. Can be an excellent framework for the use of existing system design and construction. Designed and implemented using J2EE technology to Blog is the purpose of this article lies.This article will design and implement a J2EEbased Blog system. The system uses the MVC (Model View Controller) design pattern, said layer to achieve with JSP, Servlet take control layer of the affairs, business logic encapsulated in the Java Bean in and through the DAO layer to access the database. While the use of these technologies, Blog by analyzing the characteristics of the final pletion of system architecture design and implementation. The system is mainly to plete the user login, registration and user log and announcements on the publication and management, upload photos, personal information,