我后台list<自定义的对象> list 传向前台 前台接收 自定义的对象 属性为uploadDate 的类型为Calendar
<logic:present name="list">
<logic:iterate id="Bean" indexId="ind" name="list">
<tr class=row onmouseover="this.style.backgroundColor='#E1F0FF';" onmouseout="this.style.backgroundColor=''">
<td align="center"><font class="text">${ind+1}</font></td>
<td><font class="text"><bean:write name="Bean" property="uploadDate"/> </font></td>
<td> 像上面一样 单前台出现结果为java.util.GregorianCalendar[time=1315929600000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=19,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2011,MONTH=8,WEEK_OF_YEAR=38,WEEK_OF_MONTH=3,DAY_OF_MONTH=14,DAY_OF_YEAR=257,DAY_OF_WEEK=4,DAY_一长串内容 不知大虾们有没有好 的解决方案 让其显示为2011-9-15
<bean:write name="Bean" property="uploadDate" format="yyyy-MM-dd"/>
这种方法就不用说了 不适合于Calendar 类型
<logic:present name="list">
<logic:iterate id="Bean" indexId="ind" name="list">
<tr class=row onmouseover="this.style.backgroundColor='#E1F0FF';" onmouseout="this.style.backgroundColor=''">
<td align="center"><font class="text">${ind+1}</font></td>
<td><font class="text"><bean:write name="Bean" property="uploadDate"/> </font></td>
<td> 像上面一样 单前台出现结果为java.util.GregorianCalendar[time=1315929600000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="Asia/Shanghai",offset=28800000,dstSavings=0,useDaylight=false,transitions=19,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2011,MONTH=8,WEEK_OF_YEAR=38,WEEK_OF_MONTH=3,DAY_OF_MONTH=14,DAY_OF_YEAR=257,DAY_OF_WEEK=4,DAY_一长串内容 不知大虾们有没有好 的解决方案 让其显示为2011-9-15
<bean:write name="Bean" property="uploadDate" format="yyyy-MM-dd"/>
这种方法就不用说了 不适合于Calendar 类型
解决方案 »
- 问个基础的问题
- 从洲际到二级县市的地区级联用js还是做在数据库中
- soa的困惑
- hibernate处理时间,高手请进
- 传递参数
- xfire 在handler中可以修改body中的属性值么?怎么修改
- struts中actionform的问题
- 菜鸟请教,struts的数据库操作应该怎么上手啊
- jbuilder 里面 开发CMP 建立客户端测试地时候出现错误 javax.naming.ConfigurationException. Root exception is java.rmi.MarshalExce
- 我的SQL SERVER数据库中有时间字段create_date(数值为2003-3-4这种形式),在JSP中如何根据这个字段值筛选出某一周内的记录
- java 操作excel
- 在用struts2框架写代码,部署完成,启动tomcat6的时候出现以下异常,请高手帮忙解决一下!
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Calendar c = Calendar.getInstance();
String d = sdf.format(c.getTime());
至于标签如何format没用过,lz可以把Calendar转化为Date
呵呵 直接这样写
<bean:write name="Bean" property="uploadDate.time" format="yyyy-MM-dd"/>
希望对大家有帮助