毕业设计(论文)-基于SSH的个人信息博客网站的设计与实现.doc_第1页
毕业设计(论文)-基于SSH的个人信息博客网站的设计与实现.doc_第2页
毕业设计(论文)-基于SSH的个人信息博客网站的设计与实现.doc_第3页
毕业设计(论文)-基于SSH的个人信息博客网站的设计与实现.doc_第4页
毕业设计(论文)-基于SSH的个人信息博客网站的设计与实现.doc_第5页
已阅读5页,还剩33页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

毕业设计论文题目:基于SSH的个人信息博客网站的设计与实现目录1绪论11.1选题背景11.2研究意义11.3主要内容11.4论文的组织结构12系统研究与分析32.1需求分析与可行性分析32.2系统的指导思想32.3系统的最终实现目标33系统总体设计43.1基本概述43.2系统结构43.3功能总体设计43.4数据库设计54系统详细设计与实现74.1系统首页模块功能图74.1.1用户注册登录模块74.2功能模块的实现94.2.1日志功能模块的实现104.2.2相册功能模块的实现124.2.3文件功能模块的实现154.2.4好友功能模块的实现224.2.5留言功能模块的实现255系统运行环境及相关技术275.1系统运行环境275.2所用到的相关技术276系统测试306.1测试概要306.2测试内容306.2.1单元测试307总结31致谢32参考文献33摘要越来越多的网络用户希望能够在网络平台上更多地展现自己的个性,更方便地与人互动交流,在传统的WEB1.0时代,无论是论坛、社区还是个人网站,都试图在这些方面进行努力,随着WEB2.0时代的到来,一个新的概念出现了-博客。随着计算机网络的飞速发展,博客已经成为写网络日志必不可少的一种工具,也是一种简单有效的提供网络用户之间进行在线交流的网络平台,通过其可以结交更多的朋友,表达更多的想法,它随时可以发布日志,方便快捷。个人博客的发展,也已经成为广告商业务拓展的重要领域。 因此本文主要论述了BLOG的概念、发展前景、特点和功能等。分析了个人博客系统的总体设计模式和系统的实现过程。最后,文章还论述了本系统在今后的发展方向。 本文的研究在一定程度上借鉴了新浪、QQ空间等的发展经验成果,系统的最终目的是通过为博客提供优质的互动交流平台,提高网站的知名度和访问量,从而获得为企业提供更多的产品介绍及发展的机会,提升自己的网络价值。关键词: WEB2.0;访问量;价值AbstractMore and more network users hoped that can more unfold own individuality in the network platform, interacts conveniently with the human the exchange, in traditional WEB1.0 time, regardless of being the forum, community individual website, attempts in these aspects to carry on diligently, along with WEB2.0 the time arrival, a new concept appeared-Blog. Along with computer networks swift development, the blog already became writes the network diary essential one kind of tool, is also one kind simple effective provides between the network user to carry on the online exchange the network platform, through its may become friends with more friends, expresses more ideas, it momentarily may issue the diary, facilitates quickly 。Individual blog development, also already became the advertising agent service development the important domain。 Therefore this article mainly elaborated the BLOG concept, the prospects for development, the characteristic and the function and so on. Has analyzed individual blog systems system design pattern and the system realizes the process. Finally, the article also elaborated this system in presents development direction. The this articles research has profited from sina, QQ space development experience achievement, systems final goal is to a certain extent through provides the high quality interaction for the blog to exchange the platform, enhances the website the popularity and the visit quantity, thus obtains for the enterprise provides the more product introductions and the development opportunity, promotes own network value. Key words: Web 2.0; Visits; valueV1绪论1.1选题背景在Internet飞速发展的今天,互联网成为人们快速获取、发布和传递信息的重要渠道,它在人们政治、经济、生活等各个方面发挥着重要的作用。Internet上发布信息主要是通过网站来实现的,获取信息也是要在Internet“海洋”中按照一定的检索方式将所需要的信息从网站上下载下来。这样,博客应运而生。博客是继Email、BBS 和IM之后的第四种网络交流方式,是网络时代的自媒体,是信息时代的麦哲伦;它代表着新的生活、工作方式,更代表着新的学习方式。通过博客,让自己学到很多,让别人学到更多。博客使用户的思想得到了自由的发挥体现了网络时尚、自由的文化环境。1.2研究意义随着知识经济的到来,人类已经逐步进入信息化社会。信息增长的速度越来越快,人们希望利用先进的管理理论方法手段来得到并处理越来越多的信息,以提高工作效率和管理水平。由于信息资源对人们生活的重要性,不断提高信息的收集,传输,加以利用等活动,日益成为人们社会生活的重要组成部分。在这个信息化的时代,网络技术的运用和发展将会改变大众对信息的接受方式,更改变了人们的生活、学习、工作方式。1.3主要内容随着计算机及网络技术的飞速发展,Internet/Intranet应用在全球范围内日益普及,当今社会正快速向信息化社会前进,信息管理自动化的作用也越来越大。近年来,基于互联网的各种应用也日益受到人们的重视。在小房子个人信息网中,主要实现了登录功能,发表日志,创建相册,上传文件,网络交友,网络留言等功能,充分体现了博客网站集互动、文化、娱乐及休闲为一体的强大功能。1.4论文的组织结构第一部分:绪论。介绍了论文的选题背景、研究意义、主要内容和关于本网站问题的提出。第二部分:系统研究与分析。简述网站系统开发前需要解决的问题。第三部分:系统总体设计。介绍网站系统结构设计、功能设计和数据库的设计。第四部分:系统详细设计与实现。介绍网站系统功能模块具体设计与实现。第五部分:系统运行环境及相关技术。介绍网站系统的运行环境和所用到的相关技术。第六部分:系统测试。阐述系统测试的目的与任务,分析本系统的测试过程。第七部分:结束语。阐述本系统研究中尚存在的问题及进一步开展研究的见解和建议,对整个研究工作进行归纳和综合。第八部分:致谢。简述通过本次项目设计的体会,并对指导老师致谢。第九部分:参考文献。介绍本次项目设计的参考文献。2系统研究与分析2.1需求分析与可行性分析Internet在各类新闻媒体上已成为近几年来世界范围的技术热点话题。事实上,今天Internet已经不单独属于世界上任何一个国家、地区、财团或个人,Internet正朝着全球信息基础设施方向前进,它拥有巨大的世界性的丰富的信息资源,它是未来信息高速公路的一个雏形,是一件未完成的杰作,它既存在着无数的机会,也面对着无数的挑战。随着Internet的迅速全球化、商业化、家庭化进程,它很有可能改变社会,改变生活,使人们的思维、意识发生重要的变化,从而对世界产生巨大的影响。当今社会正快速向信息化社会前进,信息管理自动化的作用也越来越大。个人信息管理是一个比较新的研究领域,它与不断发展的现代信息技术、存贮技术、通讯技术等息息相关。有了现代信息技术的支撑,个人信息管理将迈向一个全新水平。没有人怀疑Internet信息流通的双向性和交互性是其最让人“激动”的一个特性。在互联网走进生活之前,没有人敢梦想拥有自己的报纸、杂志、电台、电视台。除了政策上的制约外,一个人也根本没有操作一份传播媒体的能力。现在不同了,互联网提供了一个“表达自我”的自由天地,大家可以拥有自己的信息空间,可以建立自己的个人网站。2.2系统的指导思想项目依照方便实用性、安全可靠性、娱乐趣味性的原则,设计有关的数据库表及网站页面,并设计验证代码的正确性,并对网站进行了测试,以求达到用户的使用要求。2.3系统的最终实现目标依照方便实用性、安全可靠性、娱乐趣味性的指导思想,本设计尝试用SSH框架在网络上架构一个个人信息博客网站,给每一位用户一个轻松地自我展示、网络交友、学习交流的平台。3系统总体设计3.1基本概述本设计主要实现用户注册登录,发表日志,创建相册,上传文件,网络交友,网络留言等功能。3.2系统结构系统结构如下图3-1所示:小房子个人信息网登录前登录后登录注册访问活跃用户查看热门日志查看热门下载日志管理 相册管理 留言管理 文件管理 好友管理 图3-1系统结构3.3功能总体设计1. 登录前用户选择登录、注册、找回密码、访问其他最活跃的用户、查看热门日志、热门下载等操作功能。2. 日志管理功能。用户可以查看日志及其评论、删除日志、发表新日志。3. 相册管理功能。用户可以查看图片、删除图片、上传图片、创建相册。4. 文件管理功能。用户可以查看文件详细信息、删除文件、上传文件、下载文件、上传文件时可以添加文件描述。5. 好友管理功能。用户可以查看好友信息、访问好友、给好友留言、添加删除好友。6. 留言管理功能。用户可以查看留言信息、回复留言、删除留言。3.4数据库设计项目数据库表:1.相册表用于储存相册信息,如图3-2所示。图3-2相册表2.相册类型表用于储存相册类型信息,如图3-3所示。图3-3相册类型表3.评论表用于储存文章对应评论信息,如图3-4所示。图3-4评论表4.文章表用于储存文章信息,如图3-5所示。图3-5文章表5.文章类型表用于储存文章类型信息,如图3-6所示。图3-6文章类型表6.文件表用于储存文件信息,如图3-7所示。 图3-7文件表7.文件类型表用于储存文件类型信息,如图3-8所示。图3-8文件类型表8.好友表用于储存好友信息,如图3-9所示。图3-9好友表9.留言表用于储存留言信息,如图3-10所示。图3-10留言表10.用户表用于储存用户信息,如图3-11所示。图3-11用户表4系统详细设计与实现4.1系统首页模块功能图网站首页如下图4-1所示:图4-1网站首页关键程序代码如下:public ActionForward toLoadIndex(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response) throws IOException List topUsers=userBiz.getMostScoredUser();List topEssays=essayBiz.getMostCountComments();List topFiles=fileBiz.getMostLoadedFiles();if(topUsers.size()0&topEssays.size()0&topFiles.size()0)request.setAttribute(topUsers, topUsers);request.setAttribute(topEssays, topEssays);request.setAttribute(topFiles, topFiles);return mapping.findForward(toLoadIndex);4.1.1用户注册登录模块 注册功能如图4-2所示:图4-2注册界面登录功能如图4-3所示:图4-3登录界面关键程序代码如下:public ActionForward doLogin(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException response.setCharacterEncoding(GBK);PrintWriter out = response.getWriter();DynaActionForm dynaForm = (DynaActionForm) form;String loginId = (String) dynaForm.getString(loginId);String loginPwd = (String) dynaForm.get(loginPwd);if (null = loginId | loginPwd = null | 0 = loginId.length()| loginPwd.length() = 0) out.println(alert(用户名或密码不能为空);history.go(-1););return null;String validcode = (String) dynaForm.get(validcode);String vcode = (String) request.getSession().getAttribute(vcode);if (null = validcode | !validcode.equals(vcode) out.println(alert(验证码错误);history.go(-1););return null;User user;try user = userBiz.login(loginId, loginPwd); catch (Exception e) out.println(alert(用户名或密码错误);history.go(-1););return null;if (null != user) request.getSession(true).setAttribute(loginedUser, user);user.setLastLoginDate(new Date();userBiz.update(user);response.sendRedirect(user/index.do?operate=toMyIndex);return null; else out.println(alert(用户名或密码错误);history.go(-1););return null;4.2功能模块的实现导航是网站设计不可缺少的基础元素之一,它不仅是信息结构的基础分类,也是浏览者的网站路标。此网站导航主要为功能分类导航2部分。设计完成的网站导航的设计效果如图4-4所示:图4-4网站导航用户可以通过功能分类导航条查看相应类别的信息,功能分类导航条主要通过访问Action来实现超链接。登录进入博客后首页如图4-5所示:图4-5个人主页个人资料修改页面如图4-6所示:图4-6会员资料修改4.2.1日志功能模块的实现登录后,用户可以查看日志及日志评论、删除日志、写日志、发表新日志时可以选择或添加日志类型,选择是否对外公开。页面设计效果如图4-7、4-8、4-9所示:图4-7日志管理图4-8发表日志关键程序代码如下:public ActionForward doWriteEssay(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException User loginedUser = (User) request.getSession().getAttribute(loginedUser);Essay essay = new Essay();essay.setTitle(request.getParameter(title);essay.setContents(request.getParameter(contents);EssayType essayType = essayTypeBiz.findById(Long.valueOf(request.getParameter(typeId);essay.setEssayType(essayType); essay.setSelfish(Integer.parseInt(request.getParameter(selfish);essay.setCommentNum(Long.parseLong(0);essay.setPublishTime(new Date();essay.setUser(loginedUser);essayBiz.save(essay);response.sendRedirect(index.do?operate=toMyEssay);return null;图4-9日志页面4.2.2相册功能模块的实现登录后,用户可以查看图片、删除图片、上传图片、上传图片时可以选择或创建新相册,选择是否对外公开。页面设计效果如图4-10、4-11所示:图4-10相册管理图4-11上传图片关键程序代码如下:public ActionForward doAddAlbum(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException response.setCharacterEncoding(GBK);PrintWriter printWriter = response.getWriter();User loginedUser = (User) request.getSession().getAttribute(loginedUser);UploadForm myForm = (UploadForm) form;FormFile myFile = myForm.getMyFile();long typeId = myForm.getTypeId();int selfish = myForm.getSelfish();AlbumType albumType = albumTypeBiz.findById(typeId);if (myFile != null) String type = myFile.getContentType();if (type.equals(image/pjpeg) | type.equals(image/gif)| type.equals(image/jpg) | type.equals(image/png)| type.equals(image/bmp) try if (myFile.getFileData().length 10 * 1024 * 1024) System.out.println(文件大小:+ myFile.getFileData().length + byte);System.out.println(文件大于10M);printWriter.println(alert(上传文件大于10M,上传失败);history.go(-1););return null; String dir = request.getSession(true).getServletContext().getRealPath(/upload);File file1 = new File(dir + / + loginedUser.getLoginId();File file2 = new File(file1 + / + albumType.getName();if (!file1.exists() file1.mkdir();if (!file2.exists() file2.mkdir();FileOutputStream fos = new FileOutputStream(file2 + /+ myFile.getFileName();fos.write(myFile.getFileData();fos.flush();fos.close(); catch (Exception e) e.printStackTrace();printWriter.println(alert(上传文件错误,上传失败);history.go(-1););return null;Album album = new Album();album.setAlbumType(albumType);album.setName(myFile.getFileName();album.setSelfish(selfish);album.setUser(loginedUser);albumBiz.save(album);response.sendRedirect(index.do?operate=toMyAlbum);return null; else printWriter.println(alert(你上传文件类型不合法,上传失败);history.go(-1););return null;return null;4.2.3文件功能模块的实现登录后,用户可以查看文件详细信息、删除文件、上传文件、下载文件、上传文件时可以添加文件描述。页面设计效果如图4-12、4-13、4-14所示:图4-12文件管理图4-13文件上传关键程序代码如下:public ActionForward doAddFile(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException response.setCharacterEncoding(GBK);PrintWriter printWriter = response.getWriter();User loginedUser = (User) request.getSession().getAttribute(loginedUser);UploadForm myForm = (UploadForm) form;FormFile myFile = myForm.getMyFile();String describle = myForm.getDescrible();FileType usefulTyle = null;if (myFile != null) String type = myFile.getContentType();if (type.equals(audio/mpeg) usefulTyle = (FileType) fileTypeBiz.findByProperty(name,mp3).get(0);if (type.equals(application/msword) usefulTyle = (FileType) fileTypeBiz.findByProperty(name,doc).get(0);if (type.equals(text/plain) usefulTyle = (FileType) fileTypeBiz.findByProperty(name,txt).get(0);if (type.equals(application/octet-stream) usefulTyle = (FileType) fileTypeBiz.findByProperty(name,rar).get(0);if (type.equals(application/pdf) usefulTyle = (FileType) fileTypeBiz.findByProperty(name,pdf).get(0);if (usefulTyle != null) try String dir = request.getSession(true).getServletContext().getRealPath(/upload);File file1 = new File(dir + / + loginedUser.getLoginId();File file2 = new File(file1 + / + usefulTyle.getName();if (!file1.exists() file1.mkdir();if (!file2.exists() file2.mkdir();FileOutputStream fos = new FileOutputStream(file2 + /+ myFile.getFileName();fos.write(myFile.getFileData();fos.flush();fos.close(); catch (Exception e) e.printStackTrace();printWriter.println(alert(上传文件错误,上传失败);history.go(-1););return null;entity.File file = new entity.File();file.setName(myFile.getFileName();file.setFileType(usefulTyle);file.setDescrible(describle);file.setDonwloadNum(Long.parseLong(0);file.setUploadTime(new Date();file.setUser(loginedUser);fileBiz.save(file);response.sendRedirect(index.do?operate=toMyFiles);return null; else printWriter.println(alert(你上传文件类型不合法,上传失败);history.go(-1););return null;return null;图4-14文件下载关键程序代码如下:public ActionForward download(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException String id = request.getParameter(id);entity.File downFile = (entity.File) fileBiz.findById(Long.parseLong(id);String path = ;PrintWriter out = null;response.setCharacterEncoding(GBK);User loginedUser = (User) request.getSession().getAttribute(loginedUser);User hostUser = null;if (loginedUser = null) hostUser = (User) request.getSession().getAttribute(hostUser);String enteredId = (String) request.getSession().getAttribute(enteredId);if (enteredId != null & enteredId.length() 0 & hostUser != null) User enteredUser = (User) userBiz.findById(Long.parseLong(enteredId);if (enteredUser.getScore() 0) hostUser.setScore(hostUser.getScore() + 1);enteredUser.setScore(enteredUser.getScore() - 1);userBiz.update(hostUser);userBiz.update(enteredUser); else out = response.getWriter();out.println(alert(您的积分不足!);history.go(-1););return null; else response.sendRedirect(/SmallHouse/index.jsp);return null;if (downFile != null) if (loginedUser = null) path = /upload/ + hostUser.getLoginId() + /+ downFile.getFileType().getName() + /+ downFile.getName(); else path = /upload/ + loginedUser.getLoginId() + /+ downFile.getFileType().getName() + /+ downFile.getName();downFile.setDonwloadNum(downFile.getDonwloadNum() + 1);fileBiz.update(downFile); else response.sendRedirect(/SmallHouse/user/down_fail.jsp);return null;BufferedInputStream bis = null;BufferedOutputStream bos = null;OutputStream os = null;InputStream is = null;String filePath = request.getSession(true).getServletContext().getRealPath(path);try File downloadFile = new File(filePath);is = new FileInputStream(downloadFile);bis = new BufferedInputStream(is);os = response.getOutputStream();bos = new BufferedOutputStream(os);response.setHeader(Content-disposition, attachment;filename=+ URLEncoder.encode(path, utf-8);int bytesRead = 0;byte buffer = new byte8192;while (bytesRead = bis.read(buffer, 0, 8192) != -1) bos.write(buffer, 0, bytesRead);bos.flush();is.close();bis.close();os.close();bos.close(); catch (Exception e) e.printStackTrace();response.sendRedirect(/SmallHouse/user/down_fail.jsp);return null;downFile.setDonwloadNum(downFile.getDonwloadNum() + 1);fileBiz.update(downFile);response.sendRedirect(index.do?operate=toMyFiles);return null;4.2.4好友功能模块的实现登录后,用户可以查看好友信息、访问好友、给好友留言、删除好友、还可以站内根据用户名或地址搜索用户加为好友。页面设计效果如图4-15、4-16、4-17、所示:图4-15好友管理图4-16站内搜索关键程序代码如下:public ActionForward doSearch(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOException String keyword = request.getParameter(keyword);String propertyName = request.getParameter(select);List searchUsers = userBiz.search(propertyName, keyword);request.setAttribute(searchUsers, searchUsers);User loginedUser = (User) request.getSession().getAttribute(loginedUser);User hostUser = (User) request.getSession().getAttribute(hostUser);long uid = 0;if (loginedUser != null) uid = loginedUser.getId(); else uid = hostUser.getId();List friendAllList = friendBiz.getFriendListByUid(uid);List friendList = new ArrayList();for (Friend friend : friendAllList) if (friend.getUidM() = uid) User user = userBiz.findById(friend.getUidF();friendList.add(user);if (friend.getUidF() = uid) User user = userBiz.findById(friend.getUidM();friendList.add(user);request.setAttribute(friendList, friendList);return mapping.findForward(searchUsers);public ActionForward doMakeFriends(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response)throws IOExc

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论