springboot
YDLwordpython
这个作者很懒,什么都没留下…
展开
-
springboot连接mysql8.0问题解决
原配置如下:spring.datasource.url=jdbc:mysql://47.112.103.249:3306/management?useSSL=true&allowMultiQueries=true<dependency> <groupId>mysql</groupId> <artifactId>my...原创 2020-02-10 01:06:38 · 964 阅读 · 0 评论 -
springboot项目错误总结
先确保:1.启动类中配置mapper路径,多个包的话配置如下:@MapperScan(basePackages = {"com.wordpython.dao","com.wordpython.admin.dao"})2.在application.properties中配置mapper.xml和实体类路径,如下:mybatis.mapper-locations=classpath:co...原创 2019-10-30 11:27:22 · 348 阅读 · 0 评论 -
mybatis一对多查询 Cause: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3
报错信息:The error occurred while handling results### Error querying database. Cause: java.lang.IndexOutOfBoundsException: Index: 3, Size: 3### The error may exist in file [C:\major\IntelliJ IDEA 2019...原创 2019-10-28 17:52:51 · 7401 阅读 · 4 评论 -
项目中数据库字段 创建时间和更新时间 设置
不熟数据库之前,项目数据的更新和创建所涉及到的时间,都是在java程序里面获取系统时间,然后传到dao层执行写入后更新操作。其实这样有点不必要,因为设置数据库时间字段时,可以设置为自动获取;如下:mysqlCURRENT_TIMESTAMP 和 ON UPDATE CURRENT_TIMESTAMP 详解1.CURRENT_TIMESTAMP : 当要向数据库执行 insert操作时,如...原创 2019-10-27 20:13:23 · 3466 阅读 · 0 评论 -
pringboot项目发布到linux服务器上的过程总结
一.springboot项目打包部署到服务器两种方式二.查询linux中发布到tomcat中的项目日志三.给自己的服务器配 https四.上传项目到云服务器无需重启tomcat,一般等几分钟就会更新...原创 2019-10-24 10:25:30 · 127 阅读 · 3 评论 -
查询linux中发布到tomcat中的项目日志
方法一:用xshell连上服务器后,进入tomcat/logs目录下:执行运行命令来实时查看项目运行日志:tail -f catalina.out;Ctrl+c时tail的退出命令!方法二:用xftp直接将catalina.out日志文件下载下来,直接查看。因为方法一可能会报如下错误:该错误会造成方法一无法查看项目运行日志。建议:这样看日志不太对啊 ,项目应该有自己的日志框...原创 2019-10-24 10:15:29 · 322 阅读 · 0 评论 -
idea spring boot项目中target中没有同步更新最新目录,文件及资源
我的项目目录如下:webapp是我新建的resources文件idea不像eclipse那样自动将新保存的文件或目录及其他资源更新到target目录中,必须在pom.xml中设置<build> <!--idea不像eclipse那样自动将新保存的文件或目录及其他资源更新到target目录中,必须在pom.xml中设置如下:--> ...原创 2019-10-10 23:44:28 · 5017 阅读 · 0 评论 -
html标签iframe>的使用,thymeleaf模板 在html中引入另一个html模板
一:<iframe>解决html直接嵌套html:请看:https://www.php.cn/div-tutorial-409118.html二:thymeleaf解决html中引入另一个html模板(或html片段):请看:https://blog.csdn.net/qq_42389705/article/details/92849089...原创 2019-10-10 23:29:41 · 1376 阅读 · 0 评论 -
springboot中html要用静态文件路径问题
假如访问:http://localhost:8080/aaa/bbb/common.html第一种:<script type="text/javascript" src="/js/common.js"></script>得到的路径是:http://localhost:8080/js/common.js第二种:<script type="t...原创 2019-10-07 20:43:16 · 3788 阅读 · 0 评论 -
jquery ajax 用post请求传字符串和对象,及springboot后端接受
//传送字符串$.ajax({ url:"search", type:"POST", data:{keyword:keyword}, dataType:"JSON", success:function (data) { }})//后端@PostMapping(value = "/search")public String search(@RequestParam("...原创 2019-09-22 18:47:30 · 5103 阅读 · 0 评论 -
记录 springboot 踩过的坑
1.Whitelabel Error Page就一个启动类和简单的controller,报错404.解决方法:1.springboot基本依赖要有。2.启动类的位置:controller类所在的包必须是启动类所在的包的同一层或下层。如:启动类所在的包:com ,controller类的位置:com.wordpython.controller.2.org.apache.ibatis...原创 2019-09-06 20:33:42 · 248 阅读 · 0 评论 -
idea connect timed out 解决方法
使用IntelliJ IDEA 创建Spring Boot项目时 显示 connect timed out 解决方法:1.很多博客说将https://start.spring.io改为http://start.spring.io ,但是我这里不行,当然,如果连上移动热点的话,就算不改可以成功。2.参考转载:https://my.oschina.net/u/3183495/blog/...原创 2019-09-06 19:15:52 · 46540 阅读 · 9 评论 -
springboot配置虚拟路径后,返回数据出现乱码
https://www.cnblogs.com/uqing/p/10163094.html原创 2019-07-28 20:42:09 · 336 阅读 · 0 评论 -
springboot整合mybatis时Could not resolve type alias 'xxx'
注意:不管用下列哪种解决方法,都要在启动类中加入(总结:springboot整合mybatis要扫描三个东西:mapper接口类,映射文件xxxmapper.xml,实体类)://指定mapper接口类的位置@MapperScan(basePackages= "com.wordpython.mapper")解决方案:一:mapper.xml中的resultType中经常会用到一些自...原创 2019-07-10 11:03:05 · 23053 阅读 · 3 评论