- 博客(66)
- 收藏
- 关注
原创 MySQL -> 命令练习
cmd:"登陆":-u用户名 -p密码mysql -uroot -p123456"显示所有数据库":需要;database+s--表示复数,多个数据库show databases;"进入一个数据库":use 数据库名--可以不用;use rod;"显示现在已经进入数据库中所有的表":show tables;"显示指定数据库中所有的表":show tables from rod;"查询数据库-现在的位置在哪个数据库":查询用select,使用了类似方法的();select databa
2020-10-27 12:44:07 116
原创 SpringBoot -> 国际化html(中英文转换)
1.proeprties文件2.html<!DOCTYPE html><html lang="en" xmlns:th="http://www.thymeleaf.org"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initia
2020-10-26 19:55:10 439
原创 SpringBoot -> 使用WebMvcConfigurer扩展,视图映射(view)
1.配置SpringMvc扩展类package com.springweb.web;import org.springframework.context.annotation.Configuration;import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;import org.springframework.web.servlet.config.annotation.WebMvcConfig
2020-10-26 15:18:44 608
原创 SpringBoot -> ViewResolver(定制视图解析器)
1.视图解析类package com.rod.springweb;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.context.annotation.Bean;import org.springframework.web.servlet.View;imp
2020-10-25 22:18:37 1080
原创 SpringBoot -> Thymeleaf使用th:each遍历属性加入html
html<!DOCTYPE html><!-- xmlns:th="http://www.thymeleaf.org" 命名空间:th:--><html lang="en" xmlns:th="http://www.thymeleaf.org"><head> <meta charset="UTF-8"> <title>Title</title></head><b
2020-10-25 19:10:46 1137
原创 SpringBoot -> Thymeleaf获取map中的value显示到html中
1.html<!DOCTYPE html><!-- xmlns:th="http://www.thymeleaf.org" 命名空间:th:--><html lang="en" xmlns:th="http://www.thymeleaf.org"><head> <meta charset="UTF-8"> <title>Title</title></head><
2020-10-25 16:30:11 1236
原创 SpringBoot -> Thymaleaf自动渲染html(手动改变配置覆盖原来的配置,图片文字)
1.配置Thymaleaf <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency>2.添加html到templetes文件夹,方法指定 @Reques
2020-10-24 18:19:43 430
原创 SpringBoot -> 资源默认访问位置
1.添加jquery.js的jar <dependency> <groupId>org.webjars</groupId> <artifactId>jquery</artifactId> <version>3.5.1</version> </dependency>https://www.webjars.or
2020-10-24 16:41:04 471
原创 SpringBoot -> SLF4j日志官方示例--附加:打印到文件
import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class HelloWorld { public static void main(String[] args) { Logger logger = LoggerFactory.getLogger(HelloWorld.class); logger.info("Hello World"); }}maven的jar包–默认下载2.0.0及其以下所有版
2020-10-24 09:13:47 2335
原创 SpringBoot -> 当文件已经打成jar包后,cmd怎么运行并且修改端口号后正常运行(port)--附加:更加丝滑的方式
1.打包2.命令行启动jar端口8081正常启动3.在不改变jar包的情况下,修改端口号为8080--server.port=8080
2020-10-23 20:46:58 1346
原创 SpringBoot -> application.yaml
#active:起作用;profiles:配置文件;port:端口#这里起作用的是叫prod的那一块,相应的端口号也叫8081#启动springboot的时候起作用的就不是前面这一块,是---下面的叫做prod的那一块spring: profiles: active: prodserver: port: 8080program: age: 2222222 list: - 12 - 13 - 14 map: k1: a k2: b
2020-10-23 20:12:34 293
原创 SpringBoot -> 第一个注入Bean和Yaml配置
1.YML配置program: age: 12 list: - 12 - 13 - 14 map: k1: a k2: b string: abc animal: name: dog anInt: 112.program类–做输出类package com.rod.springboot.yaml;import org.springframework.boot.context.properties.Configuration
2020-10-22 21:12:03 419
原创 SpringBoot -> 第一个Hello
mainpackage month10;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;/** * 功能描述:SpringBootApplication:指示一个配置类, * 该类声明一个或多个@Bean方法并触发自动配置和组件扫描。这是一个方便的注释 * @ClassName Day20 * @Aut
2020-10-21 10:30:05 114
原创 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.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
2020-10-20 21:33:52 564 1
原创 SpringBoot -> spring-boot-maven-plugin爆红解决方法,当网上的其他方法解决不了时
只有一个问题,你是第一次使用这个 <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plu
2020-10-20 21:32:40 898 1
原创 Maven -> 父maven-子maven
父<?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.apache.org/POM/4.0.0 http://maven.apache.org/xsd/m
2020-10-19 21:08:04 89
原创 Maven -> pom.xml模板--settings.xml模板--中央仓库地址https://mvnrepository.com/
<?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.apache.org/POM/4.0.0 http://maven.apache.org/xsd/mav
2020-10-18 20:43:05 3119
原创 Spring -> 函数式注册对象,注入到ioc容器中,不使用注解xml方式,仅仅是用方法注入
1.要注入的类package test10month.test1018;/** * 功能描述: * @ClassName Addd * @Author: 罗德 * @Create: 2020-10-18 16:57 * @Version 1.0 */public class Addd { private int i; @Override public String toString() { return "Addd{" + "i=" + i + '}'; }
2020-10-18 17:06:40 352
原创 Spring -> 注解@Nullable
public <T> void registerBean(@Nullable String beanName, Class<T> beanClass, Object... constructorArgs) { registerBean(beanName, beanClass, (Supplier<T>) null, bd -> { for (Object arg : constructorArgs) { bd.getConstruc
2020-10-18 16:56:55 987
原创 Spring -> 日志框架模板
创建的文件名字固定为:log4j2.xml;在src下优先级不同,控制台输出的信息日志的数量会改变日志级别以及优先级排序: OFF > FATAL > ERROR > WARN > INFO > DEBUG > TRACE > ALL从没有信息,到全部信息<?xml version="1.0" encoding="UTF-8"?><!--日志级别以及优先级排序: OFF > FATAL > ERROR > WARN &g
2020-10-18 15:17:51 484
原创 Spring -> 完全注解配置类模板
import com.alibaba.druid.pool.DruidDataSource;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.springframework.context.
2020-10-18 14:53:14 170
原创 Spring -> mybatis整合,xml配置模版,数据库数据源
<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:aop="h
2020-10-18 14:51:57 202
原创 Spring -> @Transactional(),事务参数
@Transactional(propagation = Propagation.REQUIRED) public void transaction(int money, int idadd, int idreduce) { affairImp.update(money, idadd, idreduce); }REQUIRED:支持当前事务,如果不存在则创建新事务。类似于同名的EJB事务属性SUPPORTS:支持当前事务,如果不存在,则以非事务方式执行。MANDATORY:支持当前.
2020-10-17 19:15:14 190
原创 Spring -> Mybatis事务注解(@Transactional)实现回滚
1.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:
2020-10-17 15:29:14 2795
原创 Java基础 -> 自己对子类调用父类构造器的理解
子类要调用父类构造器super();调用父类的空参构造器在编译期间,jvm会读取每个类,然后创建一个init的初始化方法,init方法里有通过编译得到的你写的类中的代码按一定顺序排列init(){1.super();//这个还是要有的,是通过编译你构造器中的super得到的,因为每个类中都会有嘛,你是this();他就是this();你是带参数的,他就是带参数的,反正跟你构造器中的一样,如果你有很多构造器,就会创建多个init方法,每个方法第一句都是super(),或者this().或者带参数
2020-10-17 12:57:31 399
原创 Spring -> 用户金钱交易(数据库)事务实现
1.xml<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:
2020-10-16 22:51:48 381
原创 IDEA -> 方法注释在方法外不能获取参数的办法
1.参数是数组的这样设置:设置方法:groovyScript(“def result=’’; def params=”${_1}".replaceAll(’[\\[|\\]|\\s]’, ‘’).split(’,’).toList(); for(i = 0; i < params.size(); i++) {if(params[i] == ‘’) return result;if(i==0) result += ‘\n’; result+=’ * @param ’ + params[i] + ((
2020-10-16 22:35:21 1023 1
原创 Spring -> Mybatis配置xml及查询测试
1.xml配置文件:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" x
2020-10-16 11:08:18 366
原创 Spring -> AOP增强执行的顺序@Order,@Pointcut
1.配置类package test10month.test1014;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;import org.springframework.context.annotation.EnableAspectJAutoProxy;/** * 功能描述: */@Configur
2020-10-14 20:35:40 1238
原创 Spring -> AOP增强方法(Before,After,AfterThrowing,AfterReturning)
1.被代理的类package test10month.test1014;public interface Aop { void add();}package test10month.test1014;import org.springframework.stereotype.Component;/** * 功能描述: * @version 1.0 * @className AopImplement * @author: 罗德 * @create: 2020-10-14 1
2020-10-14 19:46:03 472
原创 Spring -> AOP动态代理,注解注入
配置类package test10month.test1013;import org.springframework.context.annotation.ComponentScan;import org.springframework.context.annotation.Configuration;/** * 功能描述: * @version 1.0 * @className SpringClass * @author: 罗德 * @create: 2020-10-13 19:45
2020-10-14 13:11:43 503
原创 Spring -> IOC完全注解方式配置(@Configuration,@ComponentSan())--附加:有参构造器注解的注入
package test10month.test1012;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.beans.factory.annotation.Qualifier;import org.springframework.beans.factory.annotation.Value;import org.springframework.context.annot
2020-10-12 21:24:28 1110
原创 Spring -> IOCxml使用注解的方式注入属性(@Autowired,@Quolifier,@Value)
1.XML<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:sc
2020-10-12 20:46:29 181
原创 Spring -> IOCxml使用注解的方式创建类对象(@Component,@Service,@Repository,@Controller)
1.XML<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:sc
2020-10-12 19:41:54 163
原创 Spring -> IOCxml注入数据库连接池
1.Spring配置<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" x
2020-10-12 15:53:06 158
原创 Spring -> IOCxml自动装配属性autowire(byName,byType)
1.配置<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.s
2020-10-12 15:03:35 322
原创 Spring -> IOCxmlBean的生命周期
1.构造函数2.set方法3.后置处理器Before4.初始化5.后置处理器After6.获取了bean对象7.关闭1.配置:<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"..
2020-10-12 14:37:35 62
原创 Java基础 -> 笔记整合(eDiary),蓝奏云下载
蓝奏云地址:https://rod.lanzous.com/b0dkcsomf密码:23zi
2020-10-12 13:01:40 4427 19
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人