zno2

随笔分类 -  Spring

1 2 下一页

SpEL (Spring Expression Language)
摘要:https://docs.spring.io/spring-framework/docs/3.0.x/reference/expressions.html 6.1 Introduction The Spring Expression Language (SpEL for short) is a po 阅读全文

posted @ 2023-07-13 18:02 zno2 阅读(64) 评论(0) 推荐(0)

@ConfigurationProperties 前缀注入属性
摘要:import java.util.LinkedHashMap; import java.util.Map; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springfra 阅读全文

posted @ 2023-07-13 18:01 zno2 阅读(93) 评论(0) 推荐(0)

spring test @ContextConfiguration(locations = { "classpath:private-*.xml" }) 不生效
摘要:查找资料该种写法未被授权,可以增加至少一级目录,或者使用具体名称 classpath:foo/private-*.xml 或者 classpath:private-sss.xml 源码中查到的资料,找到一些蛛丝马迹,但是debug断点时没有调用这个类的方法: org.springframework. 阅读全文

posted @ 2023-07-13 18:01 zno2 阅读(131) 评论(0) 推荐(0)

spring 静态变量方式加载properties 文件(支持profile)
摘要:foo-test.properties (测试环境) foo-pro.properties (生产环境) 需要根据spring.profiles.active 切换 import java.io.IOException; import java.util.Properties; import org 阅读全文

posted @ 2023-07-13 18:01 zno2 阅读(157) 评论(0) 推荐(0)

@Configration
摘要:Open Declaration org.springframework.context.annotation.Configuration @Target(value={TYPE}) @Retention(value=RUNTIME) @Documented @Component Indicates 阅读全文

posted @ 2023-07-13 18:01 zno2 阅读(43) 评论(0) 推荐(0)

Spring 方法命名为啥好多用post ?
摘要:参考:JLSPreIncrementExpressionPostIncrementExpression int a = 0; a++; // post ++a; // pre 示例: @Test public void test() { int i = 0; System.out.println(i 阅读全文

posted @ 2023-07-13 18:01 zno2 阅读(45) 评论(0) 推荐(0)

spring bean 的属性为 java.util.Properties 时如何初始化该属性
摘要:public class FooBean { private java.util.Properties attr; public java.util.Properties getAttr() { return attr; } public void setAttr(java.util.Propert 阅读全文

posted @ 2023-07-13 18:00 zno2 阅读(66) 评论(0) 推荐(0)

spring 如何解析 xml 中的元素
摘要:org.springframework.beans.factory.xml.BeanDefinitionParser 举例说明: <tx:annotation-driven transaction-manager="txManager" /> org.springframework.transact 阅读全文

posted @ 2023-07-13 18:00 zno2 阅读(31) 评论(0) 推荐(0)

Spring 事务隔离级别
摘要:其中 DEFAULT 的解释是:Use the default isolation level of the underlying datastore. 意思是不同数据库有其默认的隔离级别,使用对应数据库的默认隔离级别。 Tips: 数据库 默认隔离级别 参考文档 备注 MySQL REPEATAB 阅读全文

posted @ 2023-07-13 18:00 zno2 阅读(59) 评论(0) 推荐(0)

通过<util:property-path /> 动态配置JedisCluster 节点
摘要:配置文件(统一命名): # redis cluster redis.node1.host=192.168.1.61 redis.node1.port=7000 redis.node2.host=192.168.1.62 redis.node2.port=7000 redis.node3.host=1 阅读全文

posted @ 2023-07-13 17:59 zno2 阅读(63) 评论(0) 推荐(0)

Spring 事务不起作用(二)
摘要:当使用 spring root 和 mvc 时, mvc 一定要分开扫描组件,如果通过mvc 扫描所有组件会导致事务不起作用 一般 servlet 只扫描 web 的 组件,比如 Controller 等 其他组件如 Service 需要由 root 扫描 或者只使用 servlet @Enable 阅读全文

posted @ 2023-07-13 17:58 zno2 阅读(29) 评论(0) 推荐(0)

Configuration problem: Unable to locate Spring NamespaceHandler for XML schema
摘要:Exception in thread "main" org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring Na 阅读全文

posted @ 2023-07-13 17:57 zno2 阅读(117) 评论(0) 推荐(0)

BeanFactory 和 FactoryBean 的区别
摘要:接口 用途 package org.springframework.scripting; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPa 阅读全文

posted @ 2023-07-13 17:55 zno2 阅读(37) 评论(0) 推荐(0)

spring ©
摘要:site:spring.io pdf http://docs.spring.io/spring/docs/current/spring-framework-reference/pdf/spring-framework-reference.pdf spring boot 配置作弊手册 https:// 阅读全文

posted @ 2023-06-06 13:13 zno2 阅读(32) 评论(0) 推荐(0)

${property-name} 通过:设置默认值,格式到底是什么样的
摘要:org.springframework.beans.factory.config.PlaceholderConfigurerSupport The values to replace are specified as 'placeholders' of the form ${property-nam 阅读全文

posted @ 2023-06-02 08:09 zno2 阅读(108) 评论(0) 推荐(0)

util:constant 引入java类中的常量
摘要:实践一下 package cn.zno.ztest; public class SomeBean { private int i; public int getI() { return i; } public void setI(int i) { this.i = i; } @Override pu 阅读全文

posted @ 2023-06-01 14:16 zno2 阅读(105) 评论(0) 推荐(0)

util:list map set
摘要:package cn.zno.testutil; import java.util.List; import java.util.Map; import java.util.Set; import org.springframework.stereotype.Component; public cl 阅读全文

posted @ 2023-06-01 14:14 zno2 阅读(16) 评论(0) 推荐(0)

spring p 标签
摘要:需要引入命名空间 p 是什么含义 p 是 property 的缩写,为了简化bean的配置 完整项目 依赖 Spring Bean Configuration File [test.xml] java bean 文件 测试类 TestP.java 疑问 p:car 和 p:car-ref 用哪个? 阅读全文

posted @ 2016-08-06 08:09 zno2 阅读(316) 评论(0) 推荐(0)

事务不起作用 Closing non transactional SqlSession
摘要:spring文档地址 : http://docs.spring.io/spring/docs/4.2.0.RC1/spring-framework-reference/htmlsingle/#transaction-declarative-annotations 说明: 代理模式中,只拦截外部方法调 阅读全文

posted @ 2016-08-06 08:09 zno2 阅读(14005) 评论(0) 推荐(0)

Spring 获取资源文件路径
摘要:some.properties 位于classes 下 阅读全文

posted @ 2016-08-06 08:09 zno2 阅读(560) 评论(0) 推荐(0)

1 2 下一页

导航