在struts2中,提供了日期控件,以方便地选择日期和时间,这是通过 代码

  1. <s:head theme="ajax" />

这样,就可以在页面中使用

代码<s:datetimepicker name="todayDate" value="2007-8-9" label="Format (yyyy-MM-dd)" displayFormat="yyyy-MM-dd"/>

在页面中,就会显示出日期控件,其中displayFormat是要显示的日期格式。效果如下所示: