2007-08-27

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

关键字: 配置 webwork 拦截
答案是“不可以”,有可能会发生问题,如:

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

您还没有登录,请登录后发表评论

DavyLee
搜索本博客
最近加入圈子
存档
最新评论