gpt4 book ai didi

struts-1 - 如何预选struts html :radio button

转载 作者:行者123 更新时间:2023-12-02 19:15:11 24 4
gpt4 key购买 nike

如何预选struts 1 html:radio按钮?

谢谢玛丽亚

最佳答案

您的 Form 对象中应该有一个值,用于保存单选按钮的数据。在转发到 JSP 之前,您需要在 Form 中预先填写该值(或者在 Form 的构造函数中默认它,如果它始终默认为该值) .

Action.java

form.setRadioValue("123");

View.jsp

<html:radio property="radioValue" value="123" />  // <-- this radio will be checked
<html:radio property="radioValue" value="456" /> // <-- this radio will not be checked

关于struts-1 - 如何预选struts html :radio button,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6883008/

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