springboot
chenyang1010
通讯行业Java程序员
展开
-
Spring boot接受参数的两种方式
方式1,使用form表单传输数据,这种方式Content-type默认是"application/x-www-form-urlencoded",注意用postman发送post请求的时候需要选择此类型@PostMapping(value = "/zte/account", produces = "application/json")@ResponseBodypublic Object add...原创 2018-11-08 00:02:52 · 984 阅读 · 0 评论 -
springboot使用json形式传数据时,发生错误com.fasterxml.jackson.databind.exc.InvalidDefinitionException
json形式传参数,出现nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of com.zte.myproject1.entity.Account根据错误提示发现是pojo类缺少无参数的构造函数导致错误的pojo类:pack...原创 2018-11-08 00:10:59 · 16095 阅读 · 11 评论 -
springboot的pom文件加入dependency,结果发现包中的类无法引用
springboot的pom文件加入dependency,结果发现包中的类无法引用在使用springboot,在pom文件加入jedis的依赖时,程序中无法使用JedisPool<!-- https://mvnrepository.com/artifact/redis.clients/jedis --><dependency> <groupId>r...原创 2018-11-20 08:42:10 · 4542 阅读 · 0 评论 -
springboot-web支持
1)关于配置文件可以在resource文件夹下面生成除了application.propertites之外的其他配置文件。比如other.properties.但是other.properties文件默认不会加载,所以在java的bean文件想引用该配置文件里面的属性,必须加注解@PropertySource(“classpath:other.properties”)@PropertySo...原创 2019-08-13 23:03:30 · 97 阅读 · 0 评论 -
springboot-支持jsp
将Springboot工程打城war部署到web容器1)pom文件中需要“一排二增”A. 需要将tomcat从web组件中排除:<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifac...原创 2019-08-14 22:05:16 · 107 阅读 · 0 评论 -
springboot-thymeleaf的使用(1)
标题springboot-thymelead的使用介绍1)pom文件中引入thymeleaf所依赖的组件<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> &l...原创 2019-08-14 23:09:56 · 173 阅读 · 0 评论 -
springboot-thymeleaf的使用(2)
themeleaf高级标签的使用A. url标签的使用使用@{}来表示url,(type=${type})表示路径参数,用来替换路径参数<a th:href="@{http://www.baidu.com/{type}(type=${type})}">link1</a>或者使用@{${}}这样直接传参<div th:style="'backgroun...原创 2019-08-18 10:20:51 · 244 阅读 · 0 评论 -
springboot-websocket使用
A. 在pom文件中添加依赖<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-websocket</artifactId></dependency>B. 定义ServerEndPoint...原创 2019-09-01 21:41:46 · 187 阅读 · 0 评论