Struts的html:radio标签中不能用checked="checked",要改为:
<html:radio property="test" value="0"/>A
<html:radio property="test" value="1"/>B
<html:radio property="test" value="2"/>C在bean中(ActionForm),设置test的初值:
private String test="2";
......
public String getTest()
{
return (this.test);
} public void setTest(String test)
{
this.test=test;
}
-----------------
运行结果是选中了C。同样,如果初值test="2",则选中B。-------------
我在JSPStudio中试运行过,这样改后一切正常。
<html:radio property="test" value="0"/>A
<html:radio property="test" value="1"/>B
<html:radio property="test" value="2"/>C在bean中(ActionForm),设置test的初值:
private String test="2";
......
public String getTest()
{
return (this.test);
} public void setTest(String test)
{
this.test=test;
}
-----------------
运行结果是选中了C。同样,如果初值test="2",则选中B。-------------
我在JSPStudio中试运行过,这样改后一切正常。
解决方案 »
- mvn package
- JNDI、JMS
- 回头请教servlet调hibernate接口的问题,servlet怎么调用hibernate接口
- 问个面向对象思想的问题
- struts配置数据源问题!
- 在XSL文件中怎么判断某一元素是否存在?
- weblogic部署的时候,获取不到项目的绝对路径
- duke's bank app deployment
- 在APPLET里是否可以使用远程服务器上的JMS服务 高分 在线等待
- 手机版网页就是文字太多,隐藏了一部分,但是想要手指点上去的时候再显示出来
- 数据库怎么连接??
- 为什么我的Jbuilder7编译所有的jsp文件都全部报错?(救我把,我疯啦,散100分!)
Vector shippers = new Vector();
shippers.add(new LabelValueBean("A", "0"));
shippers.add(new LabelValueBean("B", "1"));
shippers.add(new LabelValueBean("C", "2"));
request.setAttribute ("SHIPPERS",shippers);jsp页面
<logic:iterate id="row" name="SHIPPERS">
<html:radio property="test" value="value" idName="row"/>
<bean:write name="row" property="label"/>
</logic:iterate>
已经显示出来,但是如何选中默认的radio 还要请教各位