struts不支持value的,用对象来关联吧,例如:<html:radio property="userinfo.sex"  />

解决方案 »

  1.   

    <html:radio property="userinfo.sex"  /> "userinfo.sex"表示字符串了,另外radio总要有个value的吧,这样表示的话,value为多少呢?
      

  2.   

    <td align="left">
      <html:radio  value="0" /><bean:message key="register.male"/>
      <html:radio property="sex" value="1" /><bean:message key="register.female"/>
    </td>
    应该是在后台处理时有问题,"sex"的property中有值的话<html:radio>会自动判断哪个被选中,我们都是这样做的没有问题
      

  3.   

    后台一般是在哪个bean里写的?--目前我的情况是点一个链接,然后在actionBean里做从数据库中取数据的处理,然后没有错后,转到显示个人信息(包括有性别sex的显示)的窗体
    如果是在actionBean里做处理,应该怎么做呢?
      

  4.   

    <html:radio property="sex" value="<%=userinfo.getSex()%>" /><bean:message key="register.male"/>
      <html:radio property="sex" value="<%=userinfo.getSex()%>" /><bean:message key="register.female"/>property="sex" 对应着form里面的getSex()的属性,取到一个变量值,而value应该给于一个常量值。
    <html:radio property="sex" value="0" /><bean:message key="register.male"/>
      <html:radio property="sex" value="1" /><bean:message key="register.female"/>
    当sex=0的时候男被选中;
    当sex=1的时候女被选中;
      

  5.   

    后台应该怎么处理啊?--是在actionBean中作处理吗?--能不能说具体点啊???
      

  6.   

    而且,我发现在html标签中,用checked会报错啊!---快晕死了--我感觉这么基础的一个东西,怎么这么麻烦困难呢?