jsp页面使用了iterator迭代器,迭代器中有个属性名字为time,其类型为timestamp类型的,至于为什么是这个类型嘛,就是用navicat建好数据库直接映射出来的实体类,所以就是这个类型啦,具体的方法 就是使用s:date标签,具体使用方法如下
<s:if test="userComments.size()==0">您还没有发表评论!</s:if> <s:else> <table border="1"> <s:iterator value="userComments" id="item" status="status"> <tr> <td> <s:property value='#item.username'/> <s:property value='#item.moviename'/> </td> <td> <s:date name='#item.time' format="yyyy-MM-dd HH:mm:ss"/> </td> <td> <s:property value='#item.content'/> </td> <td> <a href =" <s:url action="delcomment"> <s:param name="id" value="#item.id"/> </s:url>">删除 </a> <%request.setAttribute("commentid", "#item.id"); %> <a href =" <s:url action="getconmemt"> <s:param name="id" value="#item.id"/> <s:param name="content" value="#item.content"/> </s:url>">修改</a> </td> </td> </tr> </s:iterator> </table>转载于:https://www.cnblogs.com/weiyi1314/p/8780902.html
相关资源:数据结构—成绩单生成器