- 博客(15)
- 资源 (6)
- 收藏
- 关注
原创 Springboot 事务管理控制
1、在service实现添加事务注解@Transactional 2、回滚事务使用RuntimeException 3、在mapper添加事务注解@Transactional 经过上面三步当数据出错的时候数据才能rollback
2017-07-27 19:14:18 7005 2
原创 IDEA调试:Method breakpoints may dramatically slow down debugging
问题:Method breakpoints may dramatically slow down debugging原因:在方法上设置了断点解决方法:去掉方法断点即可
2017-07-25 13:46:51 19647 7
原创 idea报错Cannot compile Groovy files: no Groovy library is defined for module 'xx'
File-Setting-Complier 把!?*.groovy;删除保存即可
2017-07-24 13:39:01 8674 2
原创 springboot实现跨域访问
当前使用spring版本是4.3.9import org.springframework.stereotype.Component;import javax.servlet.*;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;import java.io.IOE
2017-07-21 10:26:44 1045
原创 SpringData JPA @Query分页查询 Cannot use native queries with dynamic sorting and/or pagination in method
异常信息:Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'newsDao': Invocation of init method failed; nested exception is org.springframework.data.jpa.repo
2017-07-21 09:47:11 4392
原创 maven环境搭建并运行springboot项目
1、从官网下载安装包http://maven.apache.org/ 2、解压 3、配置maven环境 前提是需要配置好jdk;我的maven环境在:D:\apache-maven-3.5.0我的电脑-----属性----高级-----环境变量-----环境变量-----新建变量名:M2_HOME变量值:D:\apache-maven-3.5.0找到path在环境变量值尾部加
2017-07-20 17:04:10 13567
转载 RESTful API 设计指南
RESTful API 设计指南 下面这张图片里面的内容是按照restful风格编写的 一、协议API与用户的通信协议,总是使用HTTPs协议。二、域名应该尽量将API部署在专用域名之下。https://api.example.com如果确定API很简单,不会有进一步扩展,可以考虑放在主域名下。https://example.org/api/三、版本(Versioning)应该将API的版
2017-07-20 13:26:38 732
原创 java中int、String的类型转换
情景:int -> Stringint i=12345;String s="";第一种方法:s=i+""; 第二种方法:s=String.valueOf(i);这两种方法有什么区别呢?作用是不是一样的呢?是不是在任何下都能互换呢?String -> ints="12345";int i;第一种方法:i=Integer.parseInt(s);第二种方法:i=Integer.valueO
2017-07-20 12:22:11 720
原创 【分享】pom仓库地址
分享一个pom仓库地址,在使用pom的时候常常会遇到缺少jar的现象,苦于还需要知道、 https://mvnrepository.com/
2017-07-18 18:04:10 746
原创 使用IDEA查看POM依赖关系
使用Intellij idea,打开的pom.xml文件,在pom文件内容上右键Diagrams–Show Dependencies,就可以看到了
2017-07-10 16:19:27 23079
原创 springboot+mybatis整合(入门)
1、使用idea创建springboot项目 选择web、mybatis 或者在pom.xml增加<dependency> <groupId>org.mybatis.spring.boot</groupId> <artifactId>mybatis-spring-boot-starter</artifactId> <versi
2017-07-10 16:10:02 1341
原创 常用springboot pom
常用springboot pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.
2017-07-10 15:54:15 1402
原创 springboot集成swagger2
1、添加pom.xml <!-- Swagger --> <dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.6.1</version> </depe
2017-07-10 15:50:59 609
原创 SpringCloudConfig配置服务器搭建与使用
1、SpringCloudConfig 配置服务Config Server 搭建 使用idea创建Config Server pom.xml<?xml version="1.0" encoding="UTF-8"?><project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSc
2017-07-10 15:37:19 2535
原创 使用IDEA快速开发Springboot入门demo
1、下载IDEA开发工具 地址:https://www.jetbrains.com/idea/ 2、使用IDEA快速创建Springboot项目 File-New-Project Spring Initializr 项目名称 选择创建的项目所需的pom,要是创建web项目必选web,其他的根据自己的需求来,也可以创建完成之后在pom.xml添加 3、自定义一个Contro
2017-07-07 16:43:32 833
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人