ITeye博客

拦截机可否放置于2个result之间?

DavyLee · 2007-08-27 10:01 · Markdown

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


<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;把删除掉或写到后面,一切恢复正常!所以大家严格按规范写比较好!

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。