日期:2014-05-18  浏览次数:20833 次

取去boolean值在radio怎么显示
在数据库读取后,在jsp页面怎么表示

启动: <input   type= "radio "   name= "m1 "value= "{怎么写} ">
停止: <input   type= "radio "   name= "m1 "value= "{怎么写} ">

谢谢!

------解决方案--------------------
如果是struts的话用true和flase好了。如果自己写的那就0,1好了。
------解决方案--------------------
<input type= "radio " ... checked />
------解决方案--------------------
我用的不是boolean,我用string型的.

<html:radio property= "ismarried " value= "1 "/> 已婚 <html:radio property= "ismarried " value= "0 "/> 未婚

Action里面用setIsmarried( "0 ")或者smarried( "1 ")付值就好了.

画面也可以是
<input type= "radio " name= "sex " value= "0 " > 男 <input type= "radio " name= "sex " value= "1 " > 女
这种形式的.
------解决方案--------------------
其实力想写什么都可以 INPUT 的东西都是以字符串的方式发送回服务器的!
------解决方案--------------------
启动: <input type= "radio " name= "m1 "value= "{怎么写} ">
停止: <input type= "radio " name= "m1 "value= "{怎么写} ">
=====================================================
启动: <input type= "radio " name= "m1 "value= " <%=dto.getproperty()%> ">
停止: <input type= "radio " name= "m1 "value= " <%=dto.getproperty1()%> ">
------解决方案--------------------
if(value==true)
{
<input type= "radio " ... checked />
}
else
{
<input type= "radio " .../>
}