posts - 110, comments - 101, trackbacks - 0, articles - 7
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理
jsp页面查询数据  取出date类型字段

java 类
1     private Date createtime;
2     private Date updatetime;
 1     public Date getCreatetime()
 2     {
 3         return createtime;
 4     }
 5 
 6     public void setCreatetime(Date createtime)
 7     {
 8         this.createtime = createtime;
 9     }
10 
11     public Date getUpdatetime()
12     {
13         return updatetime;
14     }
15 
16     public void setUpdatetime(Date updatetime)
17     {
18         this.updatetime = updatetime;
19     }

jsp页面:
 1                     <s:if test="jobChangeList.size()>0">
 2                                         <s:iterator value="jobChangeList">
 3                                             <tr>
 4                                                 <td>
 5                                                     <s:date name="createtime" format="yyyy-MM-dd" nice="false" />
 6                                                 </td>
 7                                             </tr>
 8                                         </s:iterator>
 9                                     </s:if>
10                                     <s:else>没有相关记录</s:else>


如果要取到时分秒的话 更改一下格式即可:
<s:date name="networkUserDO.createtime" format="yyyy-MM-dd HH:mm:ss"/>
结果:2009-04-16 13:26:29

只有注册用户登录后才能发表评论。


网站导航: