pipeline.xml
2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:services="http://www.alibaba.com/schema/services"
xmlns:pl-conditions="http://www.alibaba.com/schema/services/pipeline/conditions"
xmlns:pl-valves="http://www.alibaba.com/schema/services/pipeline/valves"
xsi:schemaLocation="
http://www.alibaba.com/schema/services http://localhost:8080/schema/services.xsd
http://www.alibaba.com/schema/services/pipeline/conditions http://localhost:8080/schema/services-pipeline-conditions.xsd
http://www.alibaba.com/schema/services/pipeline/valves http://localhost:8080/schema/services-pipeline-valves.xsd
http://www.springframework.org/schema/beans http://localhost:8080/schema/www.springframework.org/schema/beans/spring-beans.xsd
">
<services:pipeline >
<!-- 初始化turbine rundata,并在pipelineContext中设置可能会用到的对象(如rundata、utils),以便valve取得。 -->
<pl-valves:prepareForTurbine />
<!-- 设置日志系统的上下文,支持把当前请求的详情打印在日志中。 -->
<pl-valves:setLoggingContext />
<!-- 分析URL,取得target。 -->
<pl-valves:analyzeURL homepage="index" />
<!-- 检查csrf token,防止csrf攻击和重复提交。假如request和session中的token不匹配,则出错,或显示expired页面。 -->
<pl-valves:checkCsrfToken />
<pl-valves:loop>
<pl-valves:choose>
<when>
<!-- 执行带模板的screen,默认有layout。 -->
<pl-conditions:target-extension-condition extension="null" />
<pl-valves:performAction />
<pl-valves:performTemplateScreen />
<pl-valves:renderTemplate />
</when>
<when>
<!-- 执行不带模板的screen,无layout。 -->
<pl-conditions:target-extension-condition extension="do" />
<pl-valves:performAction />
<pl-valves:performScreen />
</when>
<when>
<!-- 创建JSON,无模板,无layout。 -->
<pl-conditions:target-extension-condition extension="json" />
<pl-valves:performScreen />
<pl-valves:renderResultAsJson />
</when>
<otherwise>
<!-- 将控制交还给servlet engine。 -->
<pl-valves:exit />
</otherwise>
</pl-valves:choose>
<!-- 假如rundata.setRedirectTarget()被设置,则循环,否则退出循环。 -->
<pl-valves:breakUnlessTargetRedirected />
</pl-valves:loop>
</services:pipeline>
</beans:beans>