- 博客(16)
- 收藏
- 关注
原创 做毕设(十六)——喜好选择
在用户登录时判断是否是初始的喜好@RequestMapping(value = "/logincheck",method = RequestMethod.POST) public String loginCheck(HttpServletRequest request,ModelMap map){ String username = request.getParameter("use
2017-11-13 10:32:21
435
1
原创 做毕设(十五)——新闻推荐
<script type="text/javascript" th:inline="javascript"> /*<![CDATA[*/ $(document).ready(function() { var xmlhttp; xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechan
2017-09-30 12:47:41
353
1
原创 做毕设(十四)——新闻标签
上次把新闻的比tag取出来了,现在把他显示到页面上。<div class="tag" th:text="${News.type}">tag</div>取出新闻类型xx,xxx,xx,xxx,xx 处理一下var tagArray = $(".tag").text().split(',');var tag = "";tag += "<ul>";for(var i=0;i<tagArray.le
2017-09-28 10:38:27
352
原创 做毕设(十三)——改首页,设置类型
刚开始版面是照着优快云极客头条做的,后来发现是做娱乐新闻网站,明显不适合了,就改一下。 效果图 在新闻实体类中加入img(预览图),preview(简介) 写个工具类/** * 预览图文工具 */public class PreviewDeal { public List<News> Deal(List<News> newsList){ for(int i=0
2017-09-26 10:39:24
372
原创 做毕设(十二)——JPA条件分页之翻页
一个网站几乎所有的数据都要分页,上一次做好了主页的点击浏览更多,而在编辑页面显然要用不同的方式。<!DOCTYPE html><html lang="en" xmlns:th="http://www.w3.org/1999/xhtml"><head> <meta charset="UTF-8"> <title>编辑专用</title> <script src="http:
2017-09-21 14:31:33
566
原创 做毕设(十一)——JPA条件分页之加载更多
public interface NewsRepository extends JpaRepository<News,Long>,JpaSpecificationExecutor{}让NewsRepository继承JpaSpecificationExecutor就可以调用条件分页查询了public Page<News> getAllNewsCriteria(int page, int size){
2017-09-20 16:49:11
281
原创 做毕设(十)——后台管理
进行已发布新闻的管理<form action="/edit/getnews"> <input type="submit" value="爬取新闻并审核"> </form> <br/> <form action="/edit/switch"> <input th:if="${session.switch==null}" type="submit"
2017-09-13 14:53:47
1772
原创 做毕设(九)——爬新闻
学习爬虫 http://blog.youkuaiyun.com/pleasecallmewhy/article/details/17594303 照样画葫芦,去爬新闻网站public class Spider { public static String SendGet(String url) { // 定义一个字符串用来存储网页内容 String result =
2017-09-12 15:39:14
554
原创 做毕设(八)——阿里云
接下来做新闻的爬取和推荐,还需要学习一个,就先把进度缓一缓。 就想把项目部署到公网上去,便买了一个阿里云学生服务器 39.108.50.202:8080<–网址 昨天下午折腾到今天中午,总算成功了。 今天又查了下我的选题,原来是要做娱乐新闻网站……到时候在改吧…… 等我本地做完再在线上部署吧
2017-09-08 17:23:56
1029
原创 做毕设(七)——删除自己的评论
做评论删除功能<form style="float: right" th:if=${session.user!=null&&session.user.username==Username} action="/comment/del" accept-charset="utf-8" method="post"> <!--这条评论id--
2017-09-07 11:10:01
676
原创 做毕设(六)——登录注册,回复他人评论
继续昨天登录注册<!--错误信息--> <div class="msg" th:text="${msg}"></div>用这个div来显示错误提示,先把功能做出来,以后再去用ajax来重新做。@RequestMapping(value = "/logincheck",method = RequestMethod.POST) public String loginCheck(H
2017-09-06 16:54:30
398
原创 做毕设(五)——继续写css
写了半天css…… 没做什么东西,把简单的登录做了下。 现在所有页面公用一个header.html,登录注册就放在这里<div class="login" th:if=${session.user==null}> <a href="/user/login">登录</a> | <a href="signup.html">注册</a> </div> <div clas
2017-09-05 17:51:03
292
原创 做毕设(四)——简单的css和错误处理
今天稍微把界面弄了弄 自定义了错误页面,因为boot中是没有web.xml这个文件的,所以我们需要使用Java config的方式来实现。@Configurationpublic class ErrorConfiguration { @Bean public EmbeddedServletContainerCustomizer containerCustomizer(){
2017-09-04 14:53:54
242
原创 做毕设(三)——用户界面
兴致很高,趁着劲头把用户界面也做起来<body align="center"> <h3 th:text="${Username}">用户名</h3> <hr/> <div th:each="cs:${Comments}"> <p th:text="${cs.comtime}">时间</p> <p th:utext="${cs.nid}">新闻<
2017-09-01 20:05:17
939
原创 做毕设(二)——跳转和评论
上一次做了从数据库取文章,可是有的文章穿插着图片,这次就解决这个问题。 我的解决方法是直接在文章中写上html标签。 但是会发现<>在源代码中被转义字符替代,在页面上依然是<img scr="image/a.jpg"> 后来发现用th:utext 即可。接着实现新闻的评论<div th:each="cs:${Comments}"> <p th:text="${cs.uid}+${cs.
2017-09-01 13:34:40
391
原创 做毕设(一)——thymeleaf取值
从零开始做一个有推荐算法的新闻网站 先设计个简单的表,包括用户表,新闻表,新闻类型表,评论表。 用spring-boot快速搭个框架。 用thymeleaf做前后端分离。 配置一下。 先实现一下简单的从数据库拿数据到页面展示。<!--主页--><div th:each="n : ${News}"> <h1 th:text="${n.title}">标题</h1>
2017-08-31 15:47:41
721
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人