随笔分类 -  springboot专题

关于学习spirngboot中遇到的问题以及解决方法,还有总结等。
摘要:DTO:数据传输对象,主要用于外部接口参数传递封装,接口与接口进行传递使用。 VO:视图对象,主要用于给前端返回页面参数使用。 DO:数据对象,主要用于数据库层传递。 DTO转DO:接口接收参数将参数转化为数据库实体操作数据库使用。 DO转DTO:将数据库层实体转化为DTO返回给客户端。 阅读全文
posted @ 2019-07-04 21:42 明天,你好啊 阅读(12857) 评论(0) 推荐(0)
摘要:log4j.rootLogger = info,stdout log4j.appender.stdout = org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.layout = org.apache.log4j.PatternLayoutlo 阅读全文
posted @ 2019-05-13 09:04 明天,你好啊 阅读(1589) 评论(0) 推荐(0)
摘要:1.连接数据库 #MyBatis 映射文件配置 指定mapper包路径mybatis.mapper-locations=classpath:com/springboot/mapper/*.xml#MyBatis扫描别名包,和 注解@Alias mybatis.type-aliases-package 阅读全文
posted @ 2019-04-15 12:04 明天,你好啊 阅读(1071) 评论(0) 推荐(0)
摘要:springboot 提供了对项目的监控功能。 1.首先添加依赖包 <!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-actuator --><dependency> <group 阅读全文
posted @ 2019-04-12 16:49 明天,你好啊 阅读(23582) 评论(0) 推荐(4)
摘要:你可以在自己创建的组件上使用@ConfigurationProperties注解,而Spring Boot自动配置的很多组件也添加了@ConfigurationProperties注解,可以通过Spring Boot支持的各种属性源对其进行配置。例如,要指定内嵌的Tomcat或Jetty服务器应监听 阅读全文
posted @ 2019-04-12 11:41 明天,你好啊 阅读(3295) 评论(1) 推荐(0)
摘要:springboot报错内容:Inferred type ‘S’ for type parameter ‘S’ is not within its bound; should extends xxxxxx /* 用以上方法findOne(id);报错,经过网上查询资料最后找到原因。解决办法如下,1、 阅读全文
posted @ 2019-01-18 17:39 明天,你好啊 阅读(1085) 评论(0) 推荐(0)
摘要:jpa中方法的命名规则必须按照严格的要求来写。不能随便的命名方法名字,具体的方法操作如下。 参照方法地址:https://blog.csdn.net/csdnchen666666/article/details/78153229 https://blog.csdn.net/sbin456/artic 阅读全文
posted @ 2019-01-18 17:37 明天,你好啊 阅读(1102) 评论(0) 推荐(0)
摘要:springboot静态文件访问的问题,相信大家也有遇到这个问题,如下图项目结构。 项目结构如上所示,静态页面引入js、css如下所示。 大家肯定都是这样写的,但是运行的话就是出不来效果,图片也不显示。原因是因为springboot项目中的一个配置文件spring.mvc.static-path-p 阅读全文
posted @ 2019-01-18 17:36 明天,你好啊 阅读(35477) 评论(0) 推荐(1)
摘要:错误信息:Cannot perform conversion to XML from legacy HTML: The nekoHTML library is not in classpath. nekoHTML 1.9.15 or newer is required for processing 阅读全文
posted @ 2019-01-18 17:34 明天,你好啊 阅读(2015) 评论(0) 推荐(0)
摘要:springBoot,默认使用的json解析框架是Jackson。 虽然jackson能够满足json的解析,如果想使用熟悉的alibaba的fastjon,我们只需要在pom文件中配置maven依赖就好。<!-- fastjson依赖库--><dependency><groupId>com.ali 阅读全文
posted @ 2019-01-18 17:33 明天,你好啊 阅读(2345) 评论(0) 推荐(0)
摘要:如果想要监控自己的项目的访问情况及查看配置信息,druid是一个很好的选择,可能你会问druid是什么?有什么用?优点是什么? Druid简介 Druid是阿里巴巴开源的数据库连接池,号称是Java语言中最好的数据库连接池,能够提供强大的监控和扩展功能。GitHub地址:https://github 阅读全文
posted @ 2019-01-18 17:32 明天,你好啊 阅读(6016) 评论(0) 推荐(1)
摘要:下面是idea软件创建的项目目录,这里总结了一下转发与重定向的问题,详解如下。 首先解释一下每个文件夹的作用,如果你是用的是idea创建的springboot项目,会在项目创建的一开始resources文件夹下自动创建static以及templates文件夹。也就是说项目初始时有java、resou 阅读全文
posted @ 2019-01-18 17:30 明天,你好啊 阅读(44942) 评论(2) 推荐(1)
摘要:html页面代码如下 <form method="post" action="/file/upload1" enctype="multipart/form-data"><p>文件:<input type="file" name="file"><input type="submit" value="上 阅读全文
posted @ 2019-01-18 17:27 明天,你好啊 阅读(460) 评论(0) 推荐(0)
摘要:spring-boot-starter-actuator的作用,actuator是监控系统健康情况的工具。使用这个功能首先要先添加依赖,如下。<!-- 监控和管理生产环境--><dependency><groupId>org.springframework.boot</groupId><artifa 阅读全文
posted @ 2019-01-18 17:26 明天,你好啊 阅读(6435) 评论(1) 推荐(0)
摘要:1、添加依赖 <!-- 发送邮件. --> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-mail</artifactId> </dependency> 2、配置app 阅读全文
posted @ 2019-01-18 17:25 明天,你好啊 阅读(276) 评论(0) 推荐(0)
摘要:错误如下:java.lang.IllegalStateException: Mapped class was not specifiedat org.springframework.util.Assert.state(Assert.java:73)at org.springframework.jdb 阅读全文
posted @ 2019-01-18 17:23 明天,你好啊 阅读(2074) 评论(2) 推荐(0)
摘要:package com.example.demo.Config; import org.springframework.ui.Model;import org.springframework.web.bind.WebDataBinder;import org.springframework.web. 阅读全文
posted @ 2019-01-18 17:22 明天,你好啊 阅读(767) 评论(0) 推荐(0)
摘要:今天使用eclipse创建springboot整合jsp出现一个问题,在idea中并没有遇到这个问题。最后发现是需要在eclipse中添加一个eclipse依赖,依赖如下: <dependency> <groupId>org.eclipse.jdt.core.compiler</groupId> < 阅读全文
posted @ 2019-01-17 18:17 明天,你好啊 阅读(815) 评论(0) 推荐(0)