简体   繁体   English

如何在struts2中显示隐藏字段

[英]How to show the hidden field in struts2

Fetching some variables in hidden field using struts2 使用struts2在隐藏字段中获取一些变量

<s:hidden name="ABCFormBean.dependentLists[0].lastNameEng" id="h_dependantLastNameEng_id"/> 

I need to display the same in the same page 我需要在同一页面上显示相同的内容

<s:property value="ABCFormBean.dependentLists[0].lastNameEng"/> 

doesnt work 不起作用

how to display the content? 如何显示内容?

Nothing gets displayed because the property value doesn't map the value in the value stack. 由于属性值未映射值堆栈中的值,因此未显示任何内容。 Bu default the action is on top of the value stack. 默认情况下,操作位于值堆栈的顶部。 If you map properties they should should be initialized and have getters and setters. 如果映射属性,则应将其初始化并具有getter和setter。 To display 显示

<s:property value="ABCFormBean.depLists[0].firstNameEng"/> 

the following method calls are expected 预期以下方法调用

getABCFormBean().getDepLists().get(0).getFirstNameEng()

If you can get this value in the action method, then you would have the values been displayed by the property tag. 如果您可以在action方法中获得该值,那么属性标签将显示这些值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM