gpt4 book ai didi

java - 在 Struts 1.x 中使用 java 设置 select 的默认值

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:51:36 25 4
gpt4 key购买 nike

我遇到过 Struts 2.x 的答案,但没有找到 struts 1.x 的答案。

我需要做的就是使用 1.x 的 HTML:SELECT 标签在页面加载时选择默认值,该标签使用 optioncollector:

<html:select property="status">
<html:optionsCollection name="statusList" label="description" value="id" />
</html:select>

看起来很简单,但我想避免为此使用 javascript。

最佳答案

你试过吗use the value attribute on the <html:select> tag

<html:select property="status" value="...your status choise here...">
<html:optionsCollection name="statusList" label="description" value="id" />
</html:select>

关于java - 在 Struts 1.x 中使用 java 设置 select 的默认值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6932659/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com