【问题标题】:Please explain Action in Struts 2.0 XML file请解释 Struts 2.0 XML 文件中的 Action
【发布时间】:2010-07-02 05:36:58
【问题描述】:
<action name="userLogin" class="com.cc.ad.web.common.UserLoginAction">
    <result name="error">/user-login.jsp</result>
    <result name="redirect" type="redirect">${retUrl}</result>
    <result name="customerRedirect" type="redirect">${customerRedirect}</result>
    <result name="supplierRedirect" type="redirect">${supplierRedirect}</result>
    <result name="diamondViewRedirect" type="redirect">${diamondViewRedirect}</result>          
    <result name="supplierPopupRedirect" type="redirect">${supplierPopup}</result>
    <result name="customerPopupRedirect" type="redirect">${customerPopup}</result>  
</action>

上面我展示了在我的 Struts XML 文件中编写的许多内容之一。这里的方法属性中没有定义任何内容,所以我很困惑在调用此操作时调用了 UserLoginAction 类的哪个方法。

【问题讨论】:

    标签: struts2 struts-action


    【解决方案1】:

    如果动作配置中没有指定方法名,Struts 会默认查找名为execute 的方法。

    Struts 2.0 Action Configuration Doc

    【讨论】:

      猜你喜欢
      • 2017-11-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多