您现在的位置是:首页 > 文章详情

10.新增博客功能-结束语---《Beetl视频课程》

日期:2018-12-12点击:454

本期视频实现发布新博客功能

一起学beetl目录:https://my.oschina.net/u/1590490?tab=newest&catalogId=6214598

作者:GK


教程进入了尾声,该讲的知识点基本讲到了,本节课不会讲新的知识点。

今天来实现最后一个功能:发布博客。

新建一个发布页面 create.html

<% layout("/common/layout.html",{title:"新建博客",notShow:true}){ %> <div class="widewrapper main"> <div class="container"> <div class="row"> <div class="col-md-6 col-md-offset-3 clean-superblock" id="contact"> <h2>Contact</h2> <form action="${ctxPath}/saveBlog" method="post" accept-charset="utf-8" class="contact-form"> <input type="text" name="title" id="contact-name" placeholder="title" class="form-control input-lg"> <input type="text" name="category" id="contact-email" placeholder="category" class="form-control input-lg"> <input type="text" name="img" placeholder="图片地址" class="form-control input-lg"> <textarea rows="10" name="content" id="contact-body" placeholder="Your Content" class="form-control input-lg"></textarea> <div class="buttons clearfix"> <button type="submit" class="btn btn-xlarge btn-clean-one">Submit</button> </div> </form> </div> </div> </div> </div> <%}%>

在后台增加两个请求:

 @GetMapping("/createBlog") public String createBlog(HttpServletRequest request) { return "create.html"; } @PostMapping("/saveBlog") public String saveBlog( Blog blog, HttpServletRequest request) { blogService.saveBlog(blog); return "redirect:/"; } 

访问 localhost:8080/createBlog进行博客新增。

到这一节该讲的知识点都讲完了,只要大家熟练的使用前几节讲的知识点,能够应付大部分场景了。

我们这一套《一起学Beetl》视频课程也结束了。

博客还有删除、修改,功能没有实现,还有更多更加丰富的功能可以实现,这些都留给大家,当做课后作业,如果有同学能提交PR更好不过了。

有人说为什么这么简单的知识点讲的这么慢,而且磕磕绊绊。

做这个视频最初的想法是,带着错误和大家一起去开发,不至于让新手在遇到错误时,束手无策,所以会有一些磕磕绊绊。

希望大家能自己去探索和发现Beetl更多高级功能,真的很强大!加油!

项目git地址:https://gitee.com/gavink/beetl-blog

视频地址:下载下来会更清晰,视频比较长,可使用倍速看

百度网盘下载: https://pan.baidu.com/s/1LyxAxlKpVXgVjwSXIbzBuA 提取码: 68im

在线播放地址:bilibili (可以调节清晰度): https://www.bilibili.com/video/av36278644/?p=10

博客目录:https://my.oschina.net/u/1590490?tab=newest&catalogId=6214598

原文链接:https://yq.aliyun.com/articles/679054
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章