360首页检索小说效果如下:

个人完成编写的schoolnet校园网主页如下

在小说模块中,包括:小说类别编号:a、校园爱情    b、动漫同人    c、校园魔法    d、轻小说    e、校园励志    f、校园修真    g、名人传记    h、古典小说    i、 国外小说。小说状态:a、连载中  b、已完结。用户可以阅读完整小说、添加小说进入书架、查看目录、投推荐票(限制只能投一次),用户有权管理自己的书架。

页面效果如下:

1、

2、

3、

4、

5、

数据库相关表设计:

xiaoshuo小说表:包含主键id、小说类别编号typeid、小说状态state、小说标题title、小说文档docu、小说推荐率recommend、点击次数click、小说描述content、更新时间creTime、小说封面photo等。
xiaoshuotype小说分类表:包含主键id、类别名称name。
bookrack书架表:包含主键id、用户userid、小说xiaoshuoid。

votereco小说推荐投票表:包含主键id、用户userid、小说xiaoshuoid

1、小说主页面html代码

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="Keywords" content="个人主页、说说、相册、好友、日志、音乐、新闻、新鲜事" />
<meta name="Description"content="超酷的校园网、校园交友平台,创新的校园资源获取与分、专注打造最好的校园真实社交网络!" />
<title>校园小说页面_校园网</title>
</head>
<body><div id="wrapper"><jsp:include page="../public/head.jsp" /><div id="page_main" class="clearfix"><div class="page-right"><div class="site-nav"><span>当前位置 : </span><a href="/schoolnet/login.do?flag=goIndexUI">首页</a>>> <a href="/schoolnet/login.do?flag=goHomeUI" title="">个人主页</a>>>小说</div><div class="page-news"><div class="content"><div class="mes_response" id="mes_response"><table><tr><th class="news-time">小说</th></tr><tr><td><p>按类型:</p><div id="clearClass" class="pages" style="margin-top:-10px"><a class="current" href="javascript:void(0)"onclick="setXiaoshuotype(this)" name="all" title="1">全部</a><c:forEach var="xiaoshuotype" items="${xiaoshuotypes }"><a href="javascript:void(0)" onclick="setXiaoshuotype(this)"name="${xiaoshuotype.id }" title="1">${xiaoshuotype.name}</a></c:forEach></div><tr><td><br /><p>按更新:</p><div id="clearClass2" class="pages"><a href="javascript:void(0)"onclick="setXiaoshuotype3(this)" name="all" title="1"class="current">全部</a> <a href="javascript:void(0)"onclick="setXiaoshuotype3(this)" name="lianzai" title="1">连载中</a> <a href="javascript:void(0)"onclick="setXiaoshuotype3(this)" name="wanjie" title="1">已完结</a></div></td></tr><tr><td><div id="showxiaoshuos"><div id="ajaxpage" class="pages" style="width:100%"><a href="javascript:void(0)"onclick="setXiaoshuotype2(this)" name="all" title="1"class="current"> 首页 </a> <a href="javascript:void(0)"onclick="setXiaoshuotype2(this)" name="all"title="${pageNow-1 }" class="current"> 上一页 </a> <ahref="javascript:void(0)"onclick="setXiaoshuotype2(this)" name="all"title="${pageNow+1 }" class="current"> 下一页 </a> <ahref="javascript:void(0)"onclick="setXiaoshuotype2(this)" name="all"title="${PageCount }" class="current"> 尾页 </a> <aclass="current2">第${pageNow }页</a><a class="current2">共${PageCount}页</a><a class="current2">${allrows }部小说</a></div></br><c:forEach var="xiaoshuo" items="${xiaoshuos }"><div class="xiaoshuos"><ahref="/schoolnet/xiaoshuo.do?flag=goxiaoshuodescript&pageNow=1&id=${xiaoshuo.id }"title="${xiaoshuo.title }"> <imgsrc="/schoolnet/Media/txt/photo/${xiaoshuo.photo }"width="104px" height="150px"></a><p class="ellipsis"><ahref="/schoolnet/xiaoshuo.do?flag=goxiaoshuodescript&pageNow=1&id=${xiaoshuo.id }"title="${xiaoshuo.title }">${xiaoshuo.title }</a></p></div></c:forEach></div></td></tr></table></div></div></div></div></div><jsp:include page="../public/foot.jsp" /></div>
</body>
</html>

2、小说详情页面html代码

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="Keywords" content="个人主页、说说、相册、好友、日志、音乐、新闻、新鲜事" />
<meta name="Description"content="超酷的校园网、校园交友平台,创新的校园资源获取与分、专注打造最好的校园真实社交网络!" />
<title>校园小说页面_校园网</title>
</head>
<body><div id="wrapper"><jsp:include page="../public/head.jsp" /><div id="page_main" class="clearfix"><div class="page-right"><div class="site-nav"><span>当前位置 : </span><a href="/schoolnet/login.do?flag=goIndexUI">首页</a><a href="/schoolnet/login.do?flag=goHomeUI" title="">个人主页</a>小说</div><div class="page-news"><div class="content"><div class="mes_response" id="mes_response"><table><tr><th class="news-time">小说</th></tr><tr><td><div><div style="float:left"><a href="/schoolnet/xiaoshuo.do?flag=goxiaoshuodescript&pageNow=1&id=${xiaoshuo.id }"title="${xiaoshuo.title }"> <img src="/schoolnet/Media/txt/photo/${xiaoshuo.photo }"width="104px" height="150px"> <br />${xiaoshuo.title }</a></div><div style="float:left;padding-left:20px"><div style="float:left;"><p>类型 : ${xiaoshuo.xiaoshuotype.name }</p><p> 状态 : <c:if test="${xiaoshuo.state==1 }">连载中</c:if><c:if test="${xiaoshuo.state==2 }">已完结</c:if></p><p>更新 : ${xiaoshuo.creTime }</p><p><span class="pages"> <a class="current" href="javascript:void(0)"onclick="javascript:window.history.go(-1)">返回</a> </span></p></div><div style="float:left;padding-left:20px"><p>点击次数 : ${xiaoshuo.click }</p><p>推荐率 : ${fn:length(userxiaoshuoreco) }</p><p>章数 : ${count }章</p><p>文档 : txt</p></div></div></div></td></tr><tr><td><input id="xiaoshuoid" value="${xiaoshuo.id }"type="hidden"> <input id="userid"value="${loginuser.id }" type="hidden"><div class="pages"><a class="current" href="/schoolnet/xiaoshuo.do?flag=goxiaoshuodisplay&pageNow=1&id=${xiaoshuo.id }">点击阅读</a><a class="current" href="/schoolnet/xiaoshuo.do?flag=goxiaoshuoshowUI&pageNow=1&id=${xiaoshuo.id }"title="${xiaoshuo.title }">查看目录</a><c:if test="${userxiaoshuo==null }"><span id="setbooks"><a href="javascript:void(0);"onclick="setBooks()" title="加入书架" class="current"style="background:#1093d7;">加入书架</a></span></c:if><c:if test="${userxiaoshuo!=null }"><a title="已在书架" class="current" style="background:#999;">已在书架</a></c:if><a href="/schoolnet/xiaoshuo.do?flag=gomyxiaoshuoUI&pageNow=1"class="current">我的书架</a><c:if test="${userxiaoshuoreco==null }"><span id="setreco"><a href="javascript:void(0);"class="current" onclick="setreco()">投推荐票</a></span></c:if><c:if test="${userxiaoshuoreco!=null }"><a title="已推荐" class="current" style="background:#999;">已推荐</a></c:if></div><p>描述:</p><p>${xiaoshuo.content }</p></td></tr></table></div></div></div></div></div><jsp:include page="../public/foot.jsp" /></div>
</body>
</html>

3、小说章数目录页面

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="Keywords" content="个人主页、说说、相册、好友、日志、音乐、新闻、新鲜事" />
<meta name="Description"content="超酷的校园网、校园交友平台,创新的校园资源获取与分、专注打造最好的校园真实社交网络!" />
<title>校园小说页面_校园网</title>
</head>
<body><div id="wrapper"><jsp:include page="../public/head.jsp" /><div id="page_main" class="clearfix"><div class="page-right"><div class="site-nav"><span>当前位置 : </span><a href="/schoolnet/login.do?flag=goIndexUI">首页</a><a href="/schoolnet/login.do?flag=goHomeUI" title="">个人主页</a>小说</div><div class="page-news"><div class="content"><div class="mes_response" id="mes_response"><table><tr><th class="news-time">小说</th> </tr><tr><td><span class="pages"> <a class="current"href="javascript:void(0)"onclick="javascript:window.history.go(-1)">返回</a> </span> <spanstyle="margin-left:220px">${xiaoshuo.title }</span></td></tr><tr><td class="pages"><c:forEach var="i" begin="1"end="${count}"><a class="pagesa" href="/schoolnet/xiaoshuo.do?flag=goxiaoshuodisplay&pageNow=${i }&id=${xiaoshuo.id}">第${i}章</a></c:forEach></td></tr></table></div></div></div></div></div><jsp:include page="../public/foot.jsp" /></div>
</body>
</html>

4、小说内容阅读页面

<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="Keywords" content="个人主页、说说、相册、好友、日志、音乐、新闻、新鲜事" />
<meta name="Description" content="超酷的校园网、校园交友平台,创新的校园资源获取与分、专注打造最好的校园真实社交网络!" />
<title>校园新小说页面_校园网</title>
</head>
<body><div id="wrapper"><jsp:include page="../public/head.jsp" /><div id="page_main" class="clearfix"><div class="page-right"><div class="site-nav"><span>当前位置 : </span><a href="/schoolnet/login.do?flag=goIndexUI">首页</a><a href="/schoolnet/login.do?flag=goHomeUI" title="">个人主页</a>小说</div><div class="page-news"><div class="content"><div class="mes_response" id="mes_response"><table><tr><th class="news-time">小说 </th></tr><div class="pages" style="margin-left:200px;">        </div><tr> <td align="center"><span>${xiaoshuo.title }</span> </td> </tr><tr><td>${str }</td> </tr></table></div><div class="pages" style="margin-left:200px;"><a href="/schoolnet/xiaoshuo.do?flag=goxiaoshuodisplay&pageNow=${page-1 }&id=${xiaoshuo.id}"class="current"> 上一章 </a> <a href="/schoolnet/xiaoshuo.do?flag=goxiaoshuoshowUI&pageNow=${page }&id=${xiaoshuo.id}"class="current"> 目录</a> <a href="/schoolnet/xiaoshuo.do?flag=goxiaoshuodisplay&pageNow=${page+1 }&id=${xiaoshuo.id}"class="current"> 下一章</a> </div></div></div></div></div><jsp:include page="../public/foot.jsp" /></div>
</body>
</html>

相关java代码

     int PagesSize=10;String pageNow=request.getParameter("pageNow");String id=request.getParameter("id");//选择小说类型为全部if("all".equals(id)){//分页查询int pageNows=Integer.valueOf(pageNow);int allrows=userService.queryallrows("from Xiaoshuo", null);int PageCount=(allrows-1)/PagesSize+1;if(pageNows<1){pageNows=1;}if(pageNows>PageCount){pageNows=PageCount;}//获取小说List<Xiaoshuo> xiaoshuos=userService.executeQueryByPage("from Xiaoshuo order by id desc", null, pageNows, PagesSize);//获取小说分类            List<Xiaoshuotype> xiaoshuotypes=userService.getResult("from Xiaoshuotype", null);request.setAttribute("xiaoshuotypes", xiaoshuotypes);request.setAttribute("xiaoshuos", xiaoshuos);request.setAttribute("pageNow", pageNows);request.setAttribute("PageCount", PageCount);request.setAttribute("allrows", allrows);}//获取连载中的小说else if("lianzai".equals(xiaoshuotypeid)){List<Xiaoshuo> xiaoshuos=universityService.executeQueryByPage("from Xiaoshuo where state=1 order by id desc", null, pageNow, pageSize);}//获取已完结的小说else if("wanjie".equals(xiaoshuotypeid)){List<Xiaoshuo> xiaoshuos=universityService.executeQueryByPage("from Xiaoshuo where state=2 order by id desc", null, pageNow, pageSize);}//选择小说类型为单类else {int pageNows=Integer.valueOf(pageNow);int allrows=userService.queryallrows("from Xiaoshuo where xiaoshuotype.id=?", new Object[]{Integer.valueOf(id)});int PageCount=(allrows-1)/PagesSize+1;if(pageNows<1){pageNows=1;}if(pageNows>PageCount){pageNows=PageCount;}List<Xiaoshuo> xiaoshuos=userService.executeQueryByPage("from Xiaoshuo where xiaoshuotype.id=? order by id desc", new Object[]{Integer.valueOf(id)}, pageNows, PagesSize);List<Xiaoshuotype> xiaoshuotypes=userService.getResult("from Xiaoshuotype", null);request.setAttribute("xiaoshuotypes", xiaoshuotypes);request.setAttribute("xiaoshuos", xiaoshuos);request.setAttribute("pageNow", pageNows);request.setAttribute("PageCount", PageCount);request.setAttribute("allrows", allrows);}String id=request.getParameter("id");Xiaoshuo xiaoshuo=(Xiaoshuo) userService.findById(Xiaoshuo.class, Integer.valueOf(id));request.setAttribute("xiaoshuo", xiaoshuo);String docu=xiaoshuo.getDocu();StringBuffer sb=GetContent.uploadHead(request,docu);Pattern p = Pattern.compile("第[一二三四五六七八九十百千]{5}章 ");Matcher m = p.matcher(sb);int count =0;int count1=Integer.valueOf(request.getParameter("pageNow"));while(m.find()){count ++;}if(count1<1){count1=1;}if(count1>count){count1=count;}if(count1<=count){//将阿拉伯数值转成中文数值String result=ChinUtil.toChin(String.valueOf(count1));String result2=ChinUtil.toChin(String.valueOf(count1+1));//截取两章之间的内容String sb1=sb.toString().substring(sb.indexOf("第"+result+"章"), sb.indexOf("第"+result2+"章"));request.setAttribute("str", sb1);request.setAttribute("page", count1);}request.setAttribute("count", count);

GetContent.java

public class GetContent {public static StringBuffer uploadHead(HttpServletRequest request,String docu){StringBuffer sb = new StringBuffer();try{//filePath就是当前这个web应用是绝对路径 String filepath=request.getSession().getServletContext().getRealPath("/");File f2=new File(filepath+"\\Media\\txt\\"+docu);BufferedReader bReader=new BufferedReader(new FileReader(f2));while (true) {String str = bReader.readLine();if (str != null) {sb.append(str + "<br/>");}if (str == null) {break;}}} catch (Exception e) {e.printStackTrace();}return sb;}
}

ChinUtil.java

public class ChinUtil{public static String toChin(String string) {String nums[]={"0","1","2","3","4","5","6","7","8","9"};String chines[]={"零","一","二","三","四","五","六","七","八","九"};String level[]={"十","百","千","万","十","百","千","亿"};//不算进制,直接将阿拉伯数值转中文数字for (int i = 0; i < nums.length; i++) {string=string.replaceAll(nums[i], chines[i]);}System.out.println(string);StringBuffer stringBuffer=new StringBuffer(string);//插入十进制单位for (int i = 0; i < string.length()-1; i++) {stringBuffer.insert(string.length()-1-i, level[i]);}System.out.println(stringBuffer.toString());String temp = new String(stringBuffer.toString());//处理零的情况while((temp.indexOf("零万")!=-1)||(temp.indexOf("零千")!=-1)||(temp.indexOf("零百")!=-1)||(temp.indexOf("零十")!=-1)||(temp.indexOf("零零")!=-1)){if(temp.indexOf("零千")!=-1){temp = temp.replaceAll("零千","零");}if(temp.indexOf("零百")!=-1){temp = temp.replaceAll("零百","零");}if(temp.indexOf("零十")!=-1){temp = temp.replaceAll("零十","零");}if(temp.indexOf("零零")!=-1){temp = temp.replaceAll("零零","零");}if((temp.indexOf("零万")!=-1)){temp = temp.replaceAll("零万","万");}}//处理个位为零的情况if(temp.lastIndexOf("零")==temp.length()-1){temp = temp.substring(0,temp.length()-1);}return temp;}
}

其他相关文章

自制仿360首页支持拼音输入全模糊搜索和自动换肤

自制仿酷我音乐专辑模块源码实现

lucene对校园网资料的全文检索

仿360小说网站的源码设计实现相关推荐

  1. 基于仿360小说网站(校园网)的源码设计实现(升级版)

    基于博文仿360小说网站的源码设计实现对小说网站的源码更新升级(动漫小说网). 网站PC电脑端效果截图: APP手机端效果截图:                                   数 ...

  2. java毕业设计小说网站mybatis+源码+调试部署+系统+数据库+lw

    java毕业设计小说网站mybatis+源码+调试部署+系统+数据库+lw java毕业设计小说网站mybatis+源码+调试部署+系统+数据库+lw 本源码技术栈: 项目架构:B/S架构 开发语言: ...

  3. 可以自动采集的小说网站程序源码

    简介: thinkphp开发的可以自动采集的小说网站程序源码,全程序自动采集.用来搭建小说网站非常适合. 开发框架是thinkphp,非常容易二次开发. 资源包里有打包好的数据库,安装后恢复一下就可以 ...

  4. 高仿精仿好123网站导航源码完整最新版

    源码的首页和内页全面更新!首页更新至目前最新版本.全新风格,更纯净.更绿色,网址最新,文件最完整的一次.还等什么?喜欢的朋友赶快下载收藏吧!一如既往纯净.完整.无错.一比一完美精仿,界面整洁.漂亮,完 ...

  5. [qt] 高仿360手机助手[含源码]

    [qt] 高仿360手机助手 实现功能如下: 1. 高仿真界面 2. 获取当前手机屏幕,以及可以截图 3. 获取手机短信/通讯录/应用信息/系统应用信息/视频/音乐. demo版地址: http:// ...

  6. 高仿360手机卫士——Android源码

    高仿360手机卫士 高仿360手机卫士界面android源码,左右滑动效果,超炫. 下载地址:http://www.devstore.cn/code/info/1173.html 运行截图:    热 ...

  7. 高仿360手机卫士应用源码

    高仿360手机卫士界面android源码,左右滑动效果,超炫. 源码下载:http://code.662p.com/list/11_1.html <ignore_js_op> 详细说明:h ...

  8. 海洋CMS仿爱美剧网站模板源码

    介绍: 海洋CMS仿爱美剧网站模板,为庆祝海洋CMS回归,特分享自用海洋cms模板一套. 自适应手机端,内含 视频 资讯 留言模块. 网盘下载地址: http://kekewl.cc/i4QrJcf4 ...

  9. 2023最新苹果CMS10仿电影先生网站自适应源码/UI简约大气极速加载

    正文: 仿电影先生网站自适应模板适用于苹果cmsV10模板,本套模板极简风格,极速加载,电脑手机多屏兼容能力强,布局美观,模板,无用户中心.无影片评论,详情功能请看演示站. 注意没有目标站的弹窗! 程 ...

最新文章

  1. 超越Google,快手落地业界首个万亿参数推荐精排模型
  2. linux添加自己的库,Linux学习笔记——例叙makefile 增加自定义共享库
  3. php调取 zabbix实时数据_zabbix-基础系列(三)-zabbix安装[官方版]
  4. 区块链到底是什么?和普通人有什么关系?
  5. 网络基本知识(1) ARP解析
  6. ssma5.3_使用SSMA v7.1 for Oracle迁移到SQL Server
  7. 2021年中国窗口句柄市场趋势报告、技术动态创新及2027年市场预测
  8. java 类 比较大小_java 类比较大小(实现Comparable接口)
  9. MIT 2018 自动驾驶课程
  10. docker镜像与容器概念
  11. PowerMILL宏自动化编程视频教程
  12. Datawhale线上组队学习汇总
  13. “前浪”微博财报里的悲喜两极
  14. python手机号码标记_python 判断号码是否可用(号码过滤)
  15. whm面板降mysql_WHMCS与Cpanel/WHM面板整合方法-Cpanel/WHM管理使用教程 | 麦田一棵葱...
  16. Windows配置互联网访问检测服务器-IspSrv
  17. 深入理解Java虚拟机(10-13)学习总结
  18. 基于GeoHash算法的地理位置检索
  19. 电信运营商的三大数据域——B域,O域,M域
  20. python爬虫获取天猫店铺信息(更新到2020年)

热门文章

  1. 机器学习与Tensorflow(6)——LSTM的Tensorflow实现、Tensorboard简单实现、CNN应用
  2. NILMTK-GPU版本(Tensorflow-gpu,pytorch-gpu,paddlepaddle-gpu类同)安装(显卡RTX系列)
  3. springboot+dubbo+mybatisplus整合seata分布式事务
  4. Linux 下的歌词秀软件
  5. Js 图片 (或者任意元素) 添加文字
  6. 呼叫中心能为企业带来多少益处
  7. 算法基础之枚举2:生理周期
  8. edge浏览器什么相当于ie的中低_微软默认浏览器:Edge对比IE 有哪些优势,哪个好?...
  9. 2019房贷利率你知道了吗?
  10. 39、网络硬件一文通