2019年5月12日

根据值获取枚举类对象工具类EnumUtils

摘要: 枚举类 公共工具类 特点: 1)能自动获取枚举类中的方法,如e.getMyCode()和m.get().getValue() 参考:https://blog.csdn.net/u010125873/article/details/81386320 另外一种通过反射实现: 链接:https://blo 阅读全文

posted @ 2019-05-12 17:26 cslj2013 阅读(3029) 评论(0) 推荐(0) 编辑

springboot学习入门简易版九---springboot2.0整合多数据源mybatis mysql8+(22)

摘要: 一个项目中配置多个数据源(链接不同库jdbc),无限大,具体多少根据内存大小 项目中多数据源如何划分:分包名(业务)或注解方式。分包名方式类似多个不同的jar,同业务需求放一个包中。 分包方式配置多数据源 项目目录结构 2.14.1 pom文件 2.14.2 创建test1包名下类 Employee 阅读全文

posted @ 2019-05-12 15:18 cslj2013 阅读(396) 评论(0) 推荐(0) 编辑

springboot学习入门简易版八---springboot2.0多环境配置、整合mybatis mysql8+(19-20)

摘要: 2.11 SpringBoot多环境配置(19) application.properties中配置 Spring.profiles.active=prd 配置环境: Application-dev.properties 开发环境 Application-test.properties 测试环境 A 阅读全文

posted @ 2019-05-12 15:11 cslj2013 阅读(274) 评论(0) 推荐(0) 编辑

springboot学习入门简易版七---springboot2.0使用@Async异步执行方法(17)

摘要: 1启动类开启异步调用注解 不开启则异步调用无效 2编写异步调用方法 3 访问:http://localhost:8080/testAsync 页面显示空,后台日志: 说明异步调用成功,未按顺序执行。 原理:使用aop技术在运行时创建一个单独线程执行 github代码:https://github.c 阅读全文

posted @ 2019-05-12 15:04 cslj2013 阅读(159) 评论(0) 推荐(0) 编辑

springboot学习入门简易版六---springboot2.0整合全局捕获异常及log4j日志(12-13)

摘要: 使用Aop实现 1创建异常请求 在原有项目基础上,jspController中创建一个可能发生异常的请求: /** * 全局捕获异常测试 * @param i * @return */ @RequestMapping("/testGloableException") @ResponseBody pu 阅读全文

posted @ 2019-05-12 15:00 cslj2013 阅读(232) 评论(0) 推荐(0) 编辑

springboot学习入门简易版五---springboot2.0整合jsp(11)

摘要: springboot对jsp支持不友好,内部tomcat对jsp不支持,需要使用外部tomcat,且必须打包为war包。 1 创建maven项目 注意:必须为war类型,否则找不到页面。 且不要把jsp页面存放在resources(原因:可能被别人访问,其次不在classes类路径中),因此,一般自 阅读全文

posted @ 2019-05-12 14:51 cslj2013 阅读(153) 评论(0) 推荐(0) 编辑

springboot学习入门简易版四---springboot2.0静态资源访问及整合freemarker视图层

摘要: 2.4.4 SpringBoot静态资源访问(9) Springboot默认提供静态资源目录位置需放在classpath下,目录名需要符合如下规则 /static /public /resources /META-INF/resources 可以在src/main/resources目录下创建sta 阅读全文

posted @ 2019-05-12 13:28 cslj2013 阅读(508) 评论(0) 推荐(0) 编辑

springboot学习入门简易版三---springboot2.0启动方式

摘要: 2.4使用@componentscan方式启动 2.4.1 @EnableAutoConfiguration 默认只扫描当前类 @EnableAutoConfiguration 默认只扫描当前类,如果再新建一个indexcontroller类,将无法被扫描。 新建indexcontroller类: 阅读全文

posted @ 2019-05-12 13:11 cslj2013 阅读(205) 评论(0) 推荐(0) 编辑

springboot学习入门简易版二---springboot2.0项目创建

摘要: 2 springboot项目创建(5) 环境要求:jdk1.8+ 项目结构: 2.1创建maven工程 Group id :com.springbootdemo Artifact id: springboot2.0_first_demo Packaging: jar 2.2pom文件配置 2.3创建 阅读全文

posted @ 2019-05-12 10:27 cslj2013 阅读(161) 评论(0) 推荐(0) 编辑

springboot学习入门简易版一---springboot2.0介绍

摘要: 1.1为什么用springboot(2) 传统项目,整合ssm或ssh,配置文件,jar冲突,整合麻烦。Tomcat容器加载web.xml配置内容 springboot完全采用注解化(使用注解方式启动springmvc,没有web.xml,springmvc3后采用注解方式启动springmvc), 阅读全文

posted @ 2019-05-12 09:59 cslj2013 阅读(100) 评论(0) 推荐(0) 编辑

导航