webapp.WEB-INF.common.pipeline.xml Maven / Gradle / Ivy
<?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:p="http://www.springframework.org/schema/p" 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.vm" /> <!-- 权限控制 --> <pl-valves:valve class="com.alibaba.otter.manager.web.webx.valve.AuthContextValve" > <beans:property name="loginLink" value="otterLoginLink" /> <beans:property name="redirectParmeter" value="done" /> </pl-valves:valve> <!-- 检查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, vm, jsp" /> <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>
© 2015 - 2024 Weber Informatics LLC | Privacy Policy