简体   繁体   English

Struts 1.x将Action Action Form属性显示为简单文本(标签)

[英]Struts 1.x Display Action Form property as simple text (label)

I am confused. 我很困惑。 It should be very obvious, but I cannot figure it out :( 它应该是非常明显的,但我无法弄清楚:(

How can I display Action Form property as simple text (label) in my .jsp page? 如何在我的.jsp页面中将Action Form属性显示为简单文本(标签)?

I can use <html:text> tag, for example, to create an input text field for the desired property but how can I simply display this value as plain text using Struts 1.x? 例如,我可以使用<html:text>标签为所需属性创建输入文本字段,但是如何使用Struts 1.x简单地将此值显示为纯文本?

<c:out value="${theActionForm.label}" /> using the JSTL or, if you really like Struts tags, <bean:write name="theActionForm" property="label" /> . <c:out value="${theActionForm.label}" />使用JSTL,或者如果你真的喜欢Struts标签,那么<bean:write name="theActionForm" property="label" />

This assumes that the action form is registered under the attribute name "theActionForm", and has a getLabel() method. 这假定操作表单在属性名称“theActionForm”下注册,并具有getLabel()方法。

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

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