如何以编程方式从Struts2标记中获取嵌套组件?

时间:2021-11-02 20:20:05

How can i get all the nested tag elements from a struts2 tag? for instance text and checkbox tags from form tag?:

如何从struts2标记中获取所有嵌套标记元素?例如来自表单标签的文本和复选框标签?:

<s:form>
 <s:text .../>
 <s:checkbox .../
<s:form>

I know that form is a tag defined in strust-tags.tld and it extends the org.apache.struts2.views.jsp.ui.FormTag, but how does it goes behind the scene to get the nested tags ?

我知道form是strust-tags.tld中定义的标签,它扩展了org.apache.struts2.views.jsp.ui.FormTag,但它是如何在场景后面获取嵌套标签的呢?

1 个解决方案

#1


use getComponentStack() method from the org.apache.struts2.components.Component class.

使用org.apache.struts2.components.Component类中的getComponentStack()方法。

#1


use getComponentStack() method from the org.apache.struts2.components.Component class.

使用org.apache.struts2.components.Component类中的getComponentStack()方法。