用与bean不同的名称将bean值输入到Struts(1.x)中的隐藏输入中

Org*_*cat 2 html jsp struts jsp-tags javabeans

因此,我有一个通用的Form Bean,它具有一些值,例如action,offer和code。

我正在开发使用此通用表单(必填)的新表单,但我想使用名称与从中获取值的bean不同的bean的值来填充表单页面。

在页面的第一次加载中,它显示一些基本数据:

Action: (hidden input, name the same as the bean)
<html:hidden property="action"/>

Offer: (user input, name the same as the bean)
<html:text property="offer"/>

Code: (hidden input, name not the same as the bean)
<html:hidden property="code"/>
Run Code Online (Sandbox Code Playgroud)

我要使用的bean是这样的:

<bean:write name="data" property="data.code.description"/>
Run Code Online (Sandbox Code Playgroud)

如何将该值(data.code.desription)放入“隐藏”代码区域,以便在提交表单时,通用表单bean可以获取该值?

Vim*_*hal 5

为什么不只是这个呢?

<html:hidden property="data.code.description" name="scoreform_bean"/>
Run Code Online (Sandbox Code Playgroud)

有关更多信息Struts html:hidden标记,请参考javadocs