---
title: "拦截机可否放置于2个result之间？"
author: "DavyLee"
date: "2007-08-27T10:01:55Z"
tags: []
slug: "2-result"
draft: false
lastmod: "2007-08-27T10:01:55Z"
id: 117093
url: "https://davylee.iteye.com/blog/117093"
---

答案是“不可以”，有可能会发生问题，如：


```

<action name="TPrettyProductGetInfo" class="dealPrettyProduct" method="getInfo">
  <result name="success" type="velocity">
   <param name="location">/product/editPrettyProduct.htm</param>
  </result>
  <result name="index" type="velocity">
    <param name="location">/product/prettyProductInfo.htm</param>
  </result>
  <interceptor-ref name="cookie"/>
  <result name="back" type="velocity">
    <param name="location">/product/addPrettyProductBack.htm</param>
  </result>
  <result name="error" type="dispatcher">/manage/err.jsp</result>
</action>

```

这是我实际开发中的一个配置，注意，拦截机写到了result的中间，而在运行中，返回的标记明明是index,但却location到了editPrettyProduct.htm；把<interceptor-ref name="cookie"/>删除掉或写到后面，一切恢复正常！所以大家严格按规范写比较好！