会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
逝意遨游
博客园
首页
新随笔
联系
订阅
管理
2020年10月23日
工厂模式
摘要: 作用 主要用来创建对象 简单工厂模式:用于创建单一的对象 方法工厂模式:用于创建重复创建对象 1.简单工厂模式 /** 简单的工厂函数 1.声明工厂函数 createPerson 2.通过工厂函数来创建对象 * */ function createPerson(name) { var o = {};
阅读全文
posted @ 2020-10-23 10:47 逝意遨游
阅读(74)
评论(0)
推荐(0)
2020年9月30日
遍历方法
摘要: 一、数组遍历 1. forEach方法 forEach是最简单、最常用的数组遍历方法,它提供一个回调函数,可用于处理数组的每一个元素,默认没有返回值。 let arr=[1,2,3,4,5];//创建数组 let res=0; arr.forEach(item=>{ item>=3?res++:re
阅读全文
posted @ 2020-09-30 15:46 逝意遨游
阅读(829)
评论(0)
推荐(0)
2017年12月12日
spring boot事务管理
摘要: 在方法前面添加 @Transactional
阅读全文
posted @ 2017-12-12 09:58 逝意遨游
阅读(168)
评论(0)
推荐(0)
2017年12月11日
spring boot整合使用jpa
摘要: 1)pom文件引入 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.4.2.RELEASE</version> </
阅读全文
posted @ 2017-12-11 17:48 逝意遨游
阅读(284)
评论(0)
推荐(0)
spring boot整合使用mybatis
摘要: 1)pom文件引入 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.2.RELEASE</version> <r
阅读全文
posted @ 2017-12-11 16:18 逝意遨游
阅读(172)
评论(0)
推荐(0)
spring boot整合使用jdbcTemplate
摘要: 1)pom文件引入 <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.5.2.RELEASE</version> </
阅读全文
posted @ 2017-12-11 15:30 逝意遨游
阅读(197)
评论(0)
推荐(0)
spring boot全局捕获异常
摘要: @ExceptionHandler 表示拦截异常 @ControllerAdvice 是 controller 的一个辅助类,最常用的就是作为全局异常处理的切面类 @ControllerAdvice 可以指定扫描范围 @ControllerAdvice 约定了几种可行的返回值,如果是直接返回 mod
阅读全文
posted @ 2017-12-11 14:05 逝意遨游
阅读(367)
评论(0)
推荐(0)
springboot 静态资源访问
摘要: 在我们开发Web应用的时候,需要引用大量的js、css、图片等静态资源。 默认配置 Spring Boot默认提供静态资源目录位置需置于classpath下,目录名需符合如下规则: /static /public /resources /META-INF/resources 举例:我们可以在src/
阅读全文
posted @ 2017-12-11 13:49 逝意遨游
阅读(154)
评论(0)
推荐(0)
spring boot项目的启动方式
摘要: 多个控制器需要运行时,需要添加扫包操作 @ComponentScan(basePackages = "com.itmayiedu.controller") @EnableAutoConfiguration public class App { public static void main(Stri
阅读全文
posted @ 2017-12-11 13:42 逝意遨游
阅读(156)
评论(0)
推荐(0)
第一个spring boot项目 springboot-helloworld
摘要: 1.创建maven项目步骤 点击file 》new 》Maven Project 勾选框住的部分,点击next进行下一步操作。 填写框住的部分,选择jar类型,点击finish,项目创建完成。 2.找到pom.xml文件引入依赖 1)引入parent <parent> <groupId>org.sp
阅读全文
posted @ 2017-12-11 12:38 逝意遨游
阅读(173)
评论(0)
推荐(0)
下一页
公告