【问题标题】:In Struts 1, What is the Default Value of Type Attribute of <action> tag?在 Struts 1 中,<action> 标签的类型属性的默认值是多少?
【发布时间】:2016-07-14 19:00:08
【问题描述】:

在Struts 1中,如果&lt;action&gt;标签的type属性没有值,那是什么意思? type 属性是否有在未明确指定时使用的默认值。

我基本上是想弄清楚以下操作的作用;如您所见,它没有type 属性;它只有pathforward 属性:

<action path="/a/b/comp" forward="/components/d/my-comp.jsp">
</action>

【问题讨论】:

标签: struts-1


【解决方案1】:

您在上面包含的操作只是从/a/b/comp.do to /components/d/my-comp.jsp 重定向。它是以下内容的简写:

<action path="/a/b/comp" 
        parameter="/components/d/my-comp.jsp"
        type="org.apache.struts.actions.ForwardAction">
      </action>

因此,对于您包含的操作,类型属性是org.apache.struts.actions.ForwardAction

【讨论】:

  • 对于 Struts 1,这应该默认为 org.apache.struts.action.Action
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-06-12
  • 2022-11-11
  • 1970-01-01
  • 2012-08-22
  • 1970-01-01
  • 2012-10-29
相关资源
最近更新 更多