首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

struts1.x中 formbean不支持Date的解决方法

2012-10-26 
struts1.x中 formbean不支持Date的解决办法只需要在formbean中加入:static{ConvertUtils.register(new Dat

struts1.x中 formbean不支持Date的解决办法

只需要在formbean中加入:

static{ConvertUtils.register(new DateConverter(),Date.class);}

?

如:public class TTextForm extends ActionForm {
?
?static{ConvertUtils.register(new DateConverter(),Date.class);}
?
?private Long holidayId;
?private String? holidayName;
?private Date dateStart;
}

?

2.给添加的页面初始化值

public class WorkForm extends ActionForm {

?

private String logStyle="POINT";//默认值

?

3.用js给select添加值:

<html:select property="planId" size="2" styleId="myplans" multiple="true">
??????????????????? ?</html:select>

?

var plans=document.getElementById("myplans");

plans.options.add(new Option("text", "value"));

?

var plen=plans.length; 获取个数

?

plans.options.remove(plans.options[0]); 移去第一个option

热点排行