Loading [MathJax]/jax/element/mml/optable/BasicLatin.js

随笔分类 -  Java.SpringBoot.Thymeleaf

摘要:有一个使用Themeleaf模板引擎的Springboot程序,装配完毕后总是跑不起来,控制台里总是报: 2022-03-24 10:29:47.196 - Started MyApplication in 3.783 seconds (JVM running for 5.625) 2022-03- 阅读全文
posted @ 2022-03-24 11:21 逆火狂飙 阅读(456) 评论(0) 推荐(0) 编辑
摘要:用sts编辑themeleaf程序时,由于自动编译的存在,增加html后启动就能访问到; 而Idea需要clean一次,手动促进一次编译,程序才能访问到新增的html文件。 END 阅读全文
posted @ 2022-03-08 16:34 逆火狂飙 阅读(38) 评论(0) 推荐(0) 编辑
摘要:Controlller中: List<String> vnames=。。。。。。 ... session.setAttribute("vnames",vnames); 页面上: <ul th:each="v:{session.vnames}"> <li th:text="{v}"></li> < 阅读全文
posted @ 2021-12-10 21:32 逆火狂飙 阅读(663) 评论(0) 推荐(1) 编辑
摘要:url: http://****/gotoEditGroup?id=28 页面取值:<span th:text="${param.id}"></span> 阅读全文
posted @ 2021-11-16 20:08 逆火狂飙 阅读(894) 评论(1) 推荐(0) 编辑
摘要:放入session: String name="abc123"; session.setAttribute("added", name); 显示: <div th:text="${session.added}"></div> 注意函数要引入session,如: public ModelAndView 阅读全文
posted @ 2021-11-12 12:33 逆火狂飙 阅读(718) 评论(0) 推荐(0) 编辑
摘要:<form action= "...." method="post" enctype="multipart/form-data" > ... </form> 注意上面红字部分,别写错就对了。 END 阅读全文
posted @ 2021-11-04 22:39 逆火狂飙 阅读(85) 评论(0) 推荐(0) 编辑
摘要:设置序号: th:text="{status.index+1}" 设置td的间隔色: th:style="'background-color:'+({status.odd}?'#fff':'#f5f2eb')" 代码: <tbody> <tr th:each="reputaton,status: 阅读全文
posted @ 2021-10-28 22:21 逆火狂飙 阅读(2046) 评论(0) 推荐(0) 编辑
摘要:<tbody> <tr th:each="reputaton,status:{rptns}"> <td th:text="{status.index+1}"></td> <td th:text="{reputaton.id}"></td> <td th:text="{reputaton.de 阅读全文
posted @ 2021-10-28 22:05 逆火狂飙 阅读(399) 评论(0) 推荐(0) 编辑
摘要:后端代码: List<String> ls=starService.getAllFamousNames(); mav.addObject("famousNames", ls); 前端代码: <ol> <li th:each="name:${famousNames}"> <span th:text=" 阅读全文
posted @ 2021-10-23 20:54 逆火狂飙 阅读(483) 评论(0) 推荐(0) 编辑
摘要:Jsp里有方便的including,Thymeleaf里怎么用呢?可以用th:replace,下面直接就案例来说明。 比如有这么一个左侧导航栏: <div class="sidebar-nav"> <a href="#dashboard-menu" class="nav-header" data-t 阅读全文
posted @ 2021-10-16 22:26 逆火狂飙 阅读(65) 评论(0) 推荐(0) 编辑
摘要:控制器中设值部分: @PostMapping(value="/userLogin") public ModelAndView login(String uname,String pswd,HttpSession httpSession) { User user=userService.searchU 阅读全文
posted @ 2021-10-16 21:23 逆火狂飙 阅读(568) 评论(0) 推荐(0) 编辑
摘要:设值部分: @Controller public class UserCtrl { ... @Autowired private UserService userService; @PostMapping(value="/userRegister") public ModelAndView regi 阅读全文
posted @ 2021-10-15 22:07 逆火狂飙 阅读(275) 评论(0) 推荐(0) 编辑
摘要:要将页面信息传递到控制器中,页面组件和控制器的注解、函数参数一定不能写错了,下面是个简单示例,有兴趣的可以参照: html页面: <div class="block-body"> <form action="userRegister" method="post"> <label>用户名</label 阅读全文
posted @ 2021-10-11 21:13 逆火狂飙 阅读(97) 评论(0) 推荐(0) 编辑
摘要:本文例程: https://files.cnblogs.com/files/heyang78/mediaCool_211010pm.rar src/main/resources/templates 这个目录如果不存在就手动创建,它用于放置你要显示的网页 src/main/resources/stat 阅读全文
posted @ 2021-10-10 18:29 逆火狂飙 阅读(680) 评论(0) 推荐(0) 编辑
摘要:今天翻以前的笔记发现了其中的Dojo代码,它被后来的JQuery取代了,jQuery又被Vue/React要赶下台了,前台真是你未唱罢我登场,程序员每次不跟还不行,跟了把总是觉得新瓶装旧酒,腻歪了。 本文例程下载: https://files.cnblogs.com/files/heyang78/m 阅读全文
posted @ 2021-09-06 21:05 逆火狂飙 阅读(3672) 评论(0) 推荐(1) 编辑
摘要:本例工程下载:https://files.cnblogs.com/files/heyang78/myBank_themeleaf_jquery3.6.rar 第一步:在resources目录下新建static目录,再在static目录里新建js目录,然后把jquery-3.6.0.min.js放进去 阅读全文
posted @ 2021-09-06 16:11 逆火狂飙 阅读(4056) 评论(0) 推荐(0) 编辑
摘要:本文例程下载:https://files.cnblogs.com/files/heyang78/myBank_themeleaf_post_addstu_210906.rar 第一步:准备含有form的页面。 ...... <table border="0px" width="160px"> <tb 阅读全文
posted @ 2021-09-06 14:40 逆火狂飙 阅读(795) 评论(0) 推荐(0) 编辑
摘要:本文例程下载:https://files.cnblogs.com/files/heyang78/myBank_showdataonpage_210906.rar 只要网页出现了,让其中显示数据就不难,因为控制器里可以注入Mapper,而Mapper是访问DB的,取出数据后放到Model里就好。随后页 阅读全文
posted @ 2021-09-06 11:58 逆火狂飙 阅读(473) 评论(0) 推荐(0) 编辑
摘要:本文例程下载:https://files.cnblogs.com/files/heyang78/myBank_thymeleaf_210906.rar 本文将带您重返石器时代,品尝下本质依旧是jsp/servlet的所谓SpringBoot/thymeleaf新酒。 正文开始: 第一步:在pom.x 阅读全文
posted @ 2021-09-06 11:26 逆火狂飙 阅读(1132) 评论(0) 推荐(0) 编辑
摘要:Problem:Jsp中有including,Thymeleaf中有无类似的语法? Solution:有,Themeleaf中提供同样功能的标签是 th:fragment="blockName" 和 th:replace="fileName::blockName" Steps: 1.在共通网页com 阅读全文
posted @ 2020-05-03 09:03 逆火狂飙 阅读(163) 评论(0) 推荐(0) 编辑

生当作人杰 死亦为鬼雄 至今思项羽 不肯过江东
点击右上角即可分享
微信分享提示