< html:radio>检查struts html标记中的单选按钮默认值 [英] <html:radio> Check radio button default in struts html tag

查看:143
本文介绍了< html:radio>检查struts html标记中的单选按钮默认值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何设置struts html标记中默认选中的单选按钮?

How to set radio button checked by default in struts html tag ?

<html:radio name="RegisterForm" property="Group"  value="<%=Contant.Male%>"/><label>Male</label><BR>
<html:radio name="RegisterForm" property="Group" value="<%=Contant.Female%>"/><label>Female</label>

在这里,我必须将Male设置为默认值.预先感谢.

Here, i have to set Male as default one. Thanks in advance.

推荐答案

只需确保您的控制器在分派到视图之前设置表单中的相应属性即可:

Just make sue that your controller sets the corresponding property in the form before dispatching to the view:

form.setGroup(Constant.Male);

这篇关于&lt; html:radio&gt;检查struts html标记中的单选按钮默认值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆