答案是“不可以”,有可能会发生问题,如:
[code]
<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>
[/code]
这是我实际开发中的一个配置,注意,拦截机写到了result的中间,而在运行中,返回的标记明明是index,但却location到了editPrettyProduct.htm;把<interceptor-ref name="cookie"/>删除掉或写到后面,一切恢复正常!所以大家严格按规范写比较好!
[code]
<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>
[/code]
这是我实际开发中的一个配置,注意,拦截机写到了result的中间,而在运行中,返回的标记明明是index,但却location到了editPrettyProduct.htm;把<interceptor-ref name="cookie"/>删除掉或写到后面,一切恢复正常!所以大家严格按规范写比较好!