Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
62bbac7
添加权重
BlitheWells Jan 24, 2018
ecb5bbf
file for testing
BlitheWells Jan 25, 2018
6188348
Create 借贷智能合约公链.md
BlitheWells Jan 30, 2018
9978d22
EXP_OF_BUGS
BlitheWells Jan 30, 2018
82be08a
Update EXP_OF_BUGS.md
BlitheWells Jan 30, 2018
114e159
Update EXP_OF_BUGS.md
BlitheWells Jan 30, 2018
c58ffc8
更新EOFException的问题
BlitheWells Feb 5, 2018
7fb78b6
Create NOTES.md
BlitheWells Feb 6, 2018
f28ac64
add link
BlitheWells Feb 6, 2018
a208a31
Update README.md
BlitheWells Feb 6, 2018
211674f
About Agile Development
BlitheWells Feb 7, 2018
b3c1efb
Update Agile_Development.md
BlitheWells Feb 7, 2018
b825b3f
Update Agile_Development.md
BlitheWells Feb 7, 2018
f7defcf
Update Agile_Development.md
BlitheWells Feb 7, 2018
46452cb
Create cryptocurrency_swap.md
BlitheWells Feb 9, 2018
4b5f13f
Create products.md
BlitheWells Feb 9, 2018
85a32c9
About Team Management
BlitheWells Feb 11, 2018
cde85b4
Create Self_Management.md
BlitheWells Feb 11, 2018
799985a
Update and rename Team_management.md to Team_Management.md
BlitheWells Feb 11, 2018
56a8f67
Update Team_Management.md
BlitheWells Feb 11, 2018
db24dee
Update Team_Management.md
BlitheWells Feb 11, 2018
af4bfed
Update Team_Management.md
BlitheWells Feb 11, 2018
1b06d80
Update Team_Management.md
BlitheWells Feb 11, 2018
25c2acd
Update Team_Management.md
BlitheWells Feb 24, 2018
0522a75
Update Team_Management.md
BlitheWells Feb 24, 2018
1af5f1e
Create Points.md
BlitheWells Feb 24, 2018
948968e
Rename example.md to NTOK-example.md
BlitheWells Feb 27, 2018
ad4a29b
Create test.md
BlitheWells Feb 27, 2018
6619222
Create points.md
BlitheWells Feb 27, 2018
fde20da
Delete test.md
BlitheWells Feb 27, 2018
1b66937
Create investment.md
BlitheWells Feb 27, 2018
b57f271
Delete Points.md
BlitheWells Feb 27, 2018
03387c5
Create 评价系统链.md
BlitheWells Feb 27, 2018
4242af9
Update 评价系统链.md
BlitheWells Feb 28, 2018
27ebcf1
Update README.md
BlitheWells Feb 28, 2018
6c28a0f
Create points.md
BlitheWells Mar 1, 2018
acb67e1
Create thought.md
BlitheWells Mar 9, 2018
55de3d8
Create RestTemplate_MessageConvert.md
BlitheWells Mar 13, 2018
425b99a
Create CORS.md
BlitheWells Mar 16, 2018
7b45136
Create nginx-command.md
BlitheWells Mar 20, 2018
3b5af14
Create 低级错误大集合.md
BlitheWells Mar 21, 2018
9331a7e
Update 低级错误大集合.md
BlitheWells Mar 21, 2018
2eaa7bd
Update 低级错误大集合.md
BlitheWells Mar 21, 2018
5d9956a
Update and rename nginx-command.md to nginx-related.md
BlitheWells Mar 22, 2018
ca7131e
Update nginx-related.md
BlitheWells Mar 22, 2018
9c30ec4
Add files via upload
BlitheWells Mar 22, 2018
8a1654d
Update nginx-related.md
BlitheWells Mar 22, 2018
12b57ac
Create web-servlet-url-pattern.md
BlitheWells Mar 27, 2018
589032b
Update web-servlet-url-pattern.md
BlitheWells Mar 27, 2018
01d406d
Update web-servlet-url-pattern.md
BlitheWells Mar 27, 2018
ff67350
Update nginx-related.md
BlitheWells Mar 30, 2018
2108bf1
Create bean-created-twice.md
BlitheWells Apr 4, 2018
fdca8d0
Update web-servlet-url-pattern.md
BlitheWells Apr 10, 2018
1762db0
Create 踩坑大作战.md
BlitheWells Apr 10, 2018
8d61576
Create UseAnnotation.md
BlitheWells Apr 11, 2018
d5f624b
Update UseAnnotation.md
BlitheWells Apr 11, 2018
77089ac
Update UseAnnotation.md
BlitheWells Apr 11, 2018
8106c3e
Create 笑话与内向.md
BlitheWells Apr 12, 2018
5cb03e1
Update 踩坑大作战.md
BlitheWells Apr 19, 2018
ef13d99
Create 最佳实践.md
BlitheWells Apr 19, 2018
71cade6
Update RestTemplate_MessageConvert.md
BlitheWells Apr 20, 2018
da50d4f
Create JacksonConverter-Ignore-unknow-properties.md
BlitheWells Apr 24, 2018
1424687
Create NewVueProject.md
BlitheWells May 23, 2018
22085cc
Create FirstMonthInJava.md
BlitheWells May 24, 2018
1ac231d
Create Transaction-Not-Work.md
BlitheWells May 25, 2018
f2f33f6
Merge pull request #2 from BlitheWells/master
BlitheWells May 25, 2018
4e2c44f
Create MergeBetweenTwoRepo.md
BlitheWells Jun 13, 2018
fc07bbd
Create 翔哥分享
BlitheWells Jun 25, 2018
50e3c44
Rename 翔哥分享 to 翔哥分享.md
BlitheWells Jun 25, 2018
6ef4df4
Create Mybatis_best_practice.md
BlitheWells Jun 29, 2018
0364460
Update Mybatis_best_practice.md
BlitheWells Jun 29, 2018
4ee21b1
Update Mybatis_best_practice.md
BlitheWells Jun 29, 2018
b06a868
增加项: 配置文件 webpack.config.js 中设置host
BlitheWells Jul 2, 2018
7371ba4
更改格式
BlitheWells Jul 2, 2018
dd727cf
Create VUE双向绑定的简易实现.md
BlitheWells Jul 3, 2018
76be3f3
VUE 中用 axios 发送数组 form 的处理方法
BlitheWells Jul 5, 2018
117d2a9
Rename VUE双向绑定的简易实现.md to 双向绑定的简易实现.md
BlitheWells Jul 5, 2018
adef80b
Update vue_axios_array_form.md
BlitheWells Jul 5, 2018
6a0d79b
Update vue_axios_array_form.md
BlitheWells Jul 5, 2018
6ab0d83
Create 好的设计实践.md
BlitheWells Jul 6, 2018
7e9cacf
Update EXP_OF_BUGS.md
BlitheWells Jul 18, 2018
43a1037
Update EXP_OF_BUGS.md
BlitheWells Jul 18, 2018
ef68a19
Create WEB项目服务端分层.md
BlitheWells Jul 24, 2018
9c431dd
Update maven.md
BlitheWells Jul 28, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions BITCOIN/NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#### 第一部分 加密
加密算法 H(x) 需要具备三个属性:
1. 碰撞阻力
>对于任意两个输入 x 和 x',且 x != x', 输出 H(x) != H(x') 则称加密算法 H(x) 具有碰撞阻力。
事实上任何一个有限位输出的加密算法都不具备碰撞阻力,但鉴于现实中找出碰撞的两个输入需要耗费很大的算力,
所以找出碰撞的概率可以忽略不计,所以一般认为 SHA256() 算法具有碰撞阻力。

2. 隐秘性
>已知加密算法的一个输出 y, 无法计算出输入 x

3. 谜题友好

27 changes: 27 additions & 0 deletions IDEARS/cryptocurrency_swap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#### 加密货币互换合约(cryptocurrency swap)

基于现在加密货币公链种类越来越多,大家对于不同加密货币的需求也越来越多,但是如果你持有EOS,却需要使用ETH的时候,
或者你需要持有ETH或者其他基于ERC2.0的币种行使投票权。

如果你用EOS去交易所兑换ETH:
1. 把EOS从你的钱包转到交易所账户(EOS 转账手续费a)
2. 用EOS买ETH(交易手续费b)
3. 把ETH从交易所账户转到自己的钱包(ETH 转账手续费c)
>总手续费:a+b+c

但是如果刚好有人需要你所持有的EOS:
1. 你把EOS转给他(EOS 转账手续费a)
2. 他把ETH转给你(ETH 转账手续费c)
>总手续费:a+c

可以节省交易所交易手续费b

#### 加密货币借贷合约

如果你持有EOS,且段时间内不需要使用,但是你需要ETH,而且你不想卖掉你的EOS,可以把你的EOS作为抵押物,然后借入等同价值的ETH,
当你不在使用ETH,归还ETH可以拿回自己的EOS。

#### 加密货币定期存储

如果你持有EOS,且长期看好EOS,把EOS存入定期,约定利息,到期赎回。

5 changes: 5 additions & 0 deletions IDEARS/products.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#### 1. 50元的话费充值,6个月充值,总金额300元,卖出价格280元,每月用户可以选择下单并使用该优惠,每月限用一次。
用户钱少,不会乐意一次使用太多金额买优惠

#### 2. 自动代扣,每月扣除用户50元话费,然后给用户充值。
拒付风险
23 changes: 23 additions & 0 deletions IDEARS/借贷智能合约公链.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#### P2P 的现状
1. 中心化的风险:
```
a. 借贷都在各个公司完成,有公司跑路风险
b. 被黑客攻击的风险
c. 硬件软件错误的风险
```
2. 其他问题:
```
a. 公司运营成本高,造成借贷双方的成本高
b. 协议合约等受制于公司
```
#### 基于区块链的借贷合约的优势:
1. 去中心化,没有平台跑路的风险
2. 黑客攻击的风险低
3. 运营成本低
4. 合约公开透明
```
侧链 -- 打包用户信息,包含用户认证信息
公链 -- 打包用户贷入贷出请求
```
借出用户可查看借款用户的认证信息

8 changes: 8 additions & 0 deletions IDEARS/评价系统链.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

基于区块链的评价系统

1. 恶意评价的问题

2. 商户不接入的问题


87 changes: 87 additions & 0 deletions J2EE/EXP_OF_BUGS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
#### 5. 格式字符串被修改,导致循环中的格式替换失效
```
问题场景:
String msg = "Hello %s!";
String[] names = ["ZhangSan", "LiSi", "WangMazi"];
for(String name: names) {
msg = String.format(msg, name);
System.out.println(msg);
}
期望结果:
Hello ZhangSan!
Hello LiSi!
Hello WangMazi!
实际结果:
Hello ZhangSan!
Hello ZhangSan!
Hello ZhangSan!
问题原因:
字符串 msg 在 “msg = String.format(msg, name);” 这个行代码中已经被替换成了 “Hello ZhangSan!”,
所以在之后的循环中无法再次被格式化。

解决方案:
在循环中处理引用类型的数据要格外小心
1. 模板类或者模板字符串最好在外层定义成 final 类型
2. 循环中的使用的变量如果对内存使用不大,可以考虑在循环内部构造

```

#### 4. 注意数据库返回 null 的问题
```
问题场景:
使用 SQL 的 SUM() 方法获取一定条件下的总数,若 WHERE 条件查出了 0 条数据,SUM() 会返回 NULL,
返回的 JAVA Object 也是 NULL,若用这个 Object 做一些处理就会报空指针异常。
解决方案:
1. 在 SQL 语句中做限制,ISNULL(SUM(amount), 0)
2. 在程序中对结果做空判断
```
#### 3. JOB 处理数据时,数据状态必须全程跟随
```
问题场景:
 多个线程同时更新订单状态,两个线程同时以 STATUS=1 查到一条订单,逻辑上两个线程都需要以 STATUS=1 为前置条件做处理
 线程 A 锁定该订单,处理业务后更改该订单状态为 STATUS=2
 线程 B 继续走,中间一步丢掉了订单状态,直接用订单 ID 再次拿到该订单,此时订单状态已经变为 STATUS=2
 线程 B 继续以 STATUS=2 状态锁定订单做处理而不自知,造成错误处理或者重复处理
解决方案:
 对于记录状态的更改,若有多线程的处理,一定要加上该业务处理的前置状态,而且这个前置状态应该贯穿整个处理流程,
 任何一个地方脱离原始流程都会造成问题
```
#### 2. 用户相关的信息查询修改等处理时一定要加上用户相关条件,以防止恶意用户对信息的篡改


#### 1. WEBService 调用抛出EOFException
阅读了一下 Jetty 9.1.x 的源码,在 org.eclipse.jetty.http.HttpParser 有下面一段代码, 抛出了 IllegalStateException 异常
```java
else if (_state==State.CLOSE)
{
// Seeking EOF
if (BufferUtil.hasContent(buffer))
{
// Just ignore data when closed
_headerBytes+=buffer.remaining();
BufferUtil.clear(buffer);
if (_maxHeaderBytes>0 && _headerBytes>_maxHeaderBytes)
{
// Don't want to waste time reading data of a closed request
throw new IllegalStateException("too much data seeking EOF");
}
}
}
else if (_state==State.CLOSED)
{
BufferUtil.clear(buffer);
}
```
```
Caused by: java.io.EOFException
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.earlyEOF(HttpReceiverOverHTTP.java:203)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:1261)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.shutdown(HttpReceiverOverHTTP.java:129)
at org.eclipse.jetty.client.http.HttpReceiverOverHTTP.receive(HttpReceiverOverHTTP.java:91)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.receive(HttpChannelOverHTTP.java:75)
at org.eclipse.jetty.client.http.HttpConnectionOverHTTP.onFillable(HttpConnectionOverHTTP.java:103)
at org.eclipse.jetty.io.AbstractConnection$1.run(AbstractConnection.java:505)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
```
org.eclipse.jetty.http.HttpParser 9.4.x 已经把上面一段代码改掉,不会再抛出 IllegalStateException。已在项目中把Jetty 的版本该为 9.4.x,持续关注是否解决问题。
28 changes: 28 additions & 0 deletions J2EE/FirstMonthInJava.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#### 为什么在 Java 中用Calendar.getInstance().getMonth() 获取的月份的值比现实中的月份少一天?
例如 2018年5月24日,getMonth()返回的值是 7
答案:因为在英文中,月份对应的英文都只是一个标识,是没有编号顺序的,所以很多语言和 Java 一样使用0作为开始
<pre>
January——1月

February——2月

March——3月

April——4月

May——5月

June——6月

July——7月

August——8月

September——9月

October——10月

November——11月

December——12月
</pre>
32 changes: 32 additions & 0 deletions J2EE/JacksonConverter-Ignore-unknow-properties.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Jackson Converter ignore unknow properties
-- Anontation version:
```java
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
```
-- XML version:
```xml
<!-- Jackson Mapper -->
<bean id="jacksonObjectMapper" class="org.codehaus.jackson.map.ObjectMapper" />
<bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
<property name="targetObject" ref="jacksonObjectMapper" />
<property name="targetMethod" value="configure" />
<property name="arguments">
<list>
<value type="com.fasterxml.jackson.databind.DeserializationFeature">FAIL_ON_UNKNOWN_PROPERTIES</value>
<value>false</value>
</list>
</property>
</bean>


<bean id="restTemplate" class="org.springframework.web.client.RestTemplate">
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter">
<property name="objectMapper" ref="jacksonObjectMapper" />
</bean>
</list>
</property>
</bean>
```
21 changes: 21 additions & 0 deletions J2EE/Mybatis_best_practice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#### 1. Mapper Dao 中如果有多个参数,要映射到注解中,需要在参数上添加 @Param("paramName") 注解。
```java
Example:
@Select("select * from aTable where field1=${p1} and field2=#{p2}")
public aMethod(@Param("p1) String firstParam, @Param("p2") String secondParam);
```

#### 2. 批量插入的写法:
```java
Example:
@Insert({
"<script>",
"insert into a_table (a, b, c) values ",
"<foreach collection='aList' item='aObj' separator=','>",
"( #{aObj.a, jdbcType=VARCHAR}, #{aObj.b}, #{aObj.c} )",
"</foreach>"
"</script>"
})
int insertBatch(@Param("aList") List<TestObject> aList);

```
36 changes: 36 additions & 0 deletions J2EE/RestTemplate_MessageConvert.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#### 使用 RestTemplate 发送请求,request是JSON字符串,response也是JSON字符串时报一下错误
> Can not deserialize instance of java.lang.String out of START_OBJECT

经过调试发现问题,在 spring.xml 中 RestTemplate 的配置如下:
```xml
<bean name="restTemplate" class="org.springframework.web.client.RestTemplate">
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
</list>
</property>
</bean>
```
如果把配置改成下面这样,就不会报错
```xml
<bean name="restTemplate" class="org.springframework.web.client.RestTemplate">
```
此时同事做了进一步假设,如果把 converter 的顺序换一下,如下,也不会报错
```xml
<bean name="restTemplate" class="org.springframework.web.client.RestTemplate">
<property name="messageConverters">
<list>
<bean class="org.springframework.http.converter.StringHttpMessageConverter" />
<bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter" />
</list>
</property>
</bean>
```
因此得出结论,RestTemplate 会默认使用第一个 Converter 去 convert 数据,所以本来应该 StringHttpMessageConverter 来处理的数据
被其他 Converter 处理时报错。

暂时先探究到这里,后续可以深入理解一下 RestTemplate 对 message 的 convert 逻辑。

关于Convert的一个不错的文章:
https://www.ibm.com/developerworks/cn/web/wa-restful/index.html
22 changes: 22 additions & 0 deletions J2EE/Transaction-Not-Work.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Spring 事务注解 @Transactional 不生效的问题

经查证 Spring 因使用了 Spring AOP 代理的原因,只能在外部类调用时才能生效。解决这个问题的方法是使用 AspectJ 代替Spring AOP 代理。

```java
ClassA:
// 若doSomething()出现异常,doSomeDBThing()中的数据库操作不会回滚。
public void doSomething() {
doSomeDBThing();
}
@Transactional
public void doSomeDBThing() {
}

ClassB:
// 若doSomeOtherThing()出现异常,doSomeDBThing()中的数据库操作会回滚。
public void doSomeOtherThing() {
new ClassA().doSomeDBThing();
}

具体参见:
https://www.ibm.com/developerworks/cn/java/j-master-spring-transactional-use/index.html
30 changes: 30 additions & 0 deletions J2EE/UseAnnotation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#### Want to get all classes under one annotation
1. Add dependency
```xml
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
<version>0.9.10</version>
</dependency>
```
2. Implements as below
```java
public void getAllClassesWithAnotaion(String pkgName) {

Reflections reflections = new Reflections(pkgName);
Set<Class<?>> classesList = reflections.getTypesAnnotatedWith(Path.class);

for (Class<?> classes : classesList) {
//得到该类下面的所有方法
Method[] methods = classes.getDeclaredMethods();
System.out.println(classes.getName());
for (Method method : methods) {
//得到该类下面的Path注解
Path path = method.getAnnotation(Path.class);
if (null != path) {
System.out.println(path.value() + " | " + method.getName());
}
}
}
}
```
12 changes: 12 additions & 0 deletions J2EE/WEB项目服务端分层.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
一直在模仿别人的代码结构,如果不了解里面的分层逻辑,就一直不能真正分好层,写出来的代码就很乱。

从开始写web项目,就是 Controller, Service, DAO 主要是这三层结构。结构划分还是很好的,但是要弄清楚三层的职责划分,在写代码是严格按照规则来做。
<pre>
Controller 层:
主要职责:定义web服务接口, 处理登陆等非业务逻辑。
Controller 层不建议写太多逻辑,在Controller层做好try catch 异常处理,应分为业务异常和系统异常,业务异常应按照不同的错误返回不同的错误码和错误消息,系统异常,统一返回消息。catch 中打印异常log信息。

Service 层:
主要职责:业务逻辑实现,事务管理。
Service 层主要是业务逻辑的实现,给Controller层调用,进行数据的处理组装,调用DAO层。Transaction的管理建议写在这一层,对需要加Transaction的方法一定要被Controller层直接调用,因为主流框架Spring的事务管理是通过代理实现的,所以需要外部调用,内部调用会造成事务失效。
</pre>
39 changes: 39 additions & 0 deletions J2EE/bean-created-twice.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
在做一个 Spring MVC 的项目迁移的时候,启动容器一直会报异常。

> java.lang.RuntimeException: xxx-job jobhandler naming conflicts.

很明显是名字冲突了,顺着异常代码找到该类的配置,异常发生在 bean 加载时调用的 init-method 方法 start 里面
```xml
<bean id="xxx" class="com.xxx.Xlass" init-method="start" destroy-method="destroy" >
......
<bean>
```
由于实例化的类是第三方jar包中的类,无法看到源代码,调试的时候就不是很方便。
经过反编译的代码分析,Xlass 的start方法维护了一个 static 的 ConcurrentHashMap,然后会把其他一些有特殊 anotation 的类注册到这个 Map 中。
注册前先在 Map 中取对应key的值,如果能拿到就抛出异常,按照这个代码逻辑,初步判断该类的start方法被调用了两次,造成类被重复注册。

查看web.xml 的配置有如下部分
```xml
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath*:spring/spring.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>ppdServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath*:spring/spring.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
```
容器的 context 配置文件地址和 spring 的 DispatcherServlet 的配置文件地址是一致的,项目一直这样配置没有什么问题,但是这样配置十分可疑,
于是将 spring.xml 文件拆分为两部分,spring-servlet.xml 和 spring.xml, spring-servlet.xml 中只有需要加载的 servlet 相关的,
以及 Xlass, spring.xml 中为所有其他的配置。经过这样修改后启动容器,不再报错,问题解决。
所以上面那样配置 web.xml,实例很可能被加载两次,在真实的调用过程中是否会被执行两次不知道,这个还需要验证。
3 changes: 3 additions & 0 deletions J2EE/thought.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
1. 如果有同一个业务流程,只是流程和参数有一些不同,可以抽象一个类,定义业务方法。
然后不同的流程新建类继承父类并重写业务方法,需要的时候在每个子类重写的方法中都
去调用父类的方法来实现一些需要对这类方法进行统一的过滤等的操作。
Loading