我使用的是执行一个查询
select lastlevel as VERSION,name as DESCRIPTION,
TO_DATE(lastdate, 'DDMONYYYY_HH24:MI:SS') as RELEASEDATE
from mytable where rownum<=10
这里列lastdate为varchar类型
这给造成这样的
Version Release Date
1.0 2002-11-22
2.0 2003-02-08
我设置这样在这里上面的查询结果setLastDate为压延机类型的,所以我很喜欢设定发布日期的结果的方法
if (rs.getString("VERSION") != null ) { bean.setLastLevel(rs.getString("VERSION").trim());
}
if (rs.getDate("RELEASEDATE") != null )
{
Calendar calendar = Calendar.getInstance();
calendar.setTime(rs.getDate("RELEASEDATE"));
bean.setLastDate(calendar);
}
该值在这样的2003年2月8日在bean被设置。 在结束我加入这个结果豆到一个数组列表“列表”等list.add(豆);
现在我想在jsp中所有该值。 我使用Spring MVC的,所以我返回查看与ArrayList的“清单”。 当我在JSP迭代值这样的
<c:forEach var="list" items="${list}">
<td valign="top">${list.lastLevel}</td>
<td valign="top">${list.lastDate}</td>
</c:forEach>
在JSP而不是让日我收到这样的
Version Release Date
1.0 java.util.GregorianCalendar[time=1037775600000,areFieldsSet=true,
areAllFieldsSet =真,宽大=真,区= sun.util.calendar.ZoneInfo [ID = “US /亚利桑那”,偏移= -25200000,dstSavings = 0,useDaylight =假,转换= 12,lastRule =空],Firstdayofweek可= 1,minimalDaysInFirstWeek = 1,ERA = 1,YEAR = 2002,月= 10,WEEK_OF_YEAR = 47,WEEK_OF_MONTH = 4,DAY_OF_MONTH = 20,DAY_OF_YEAR = 324,DAY_OF_WEEK = 4,DAY_OF_WEEK_IN_MONTH = 3,AM_PM = 0,HOUR = 0, HOUR_OF_DAY = 0,MINUTE = 0,SECOND = 0,微差= 0,ZONE_OFFSET = -25200000,DST_OFFSET = 0]
2.0 java.util.GregorianCalendar[time=1044687600000,areFieldsSet=true,
areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="US/Arizona",offset=-25200000,dstSavings=0,useDaylight=false,transitions=12,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2003,MONTH=1,WEEK_OF_YEAR=6,WEEK_OF_MONTH=2,DAY_OF_MONTH=8,DAY_OF_YEAR=39,DAY_OF_WEEK=7,DAY_OF_WEEK_IN_MONTH=2,AM_PM=0,HOUR=0,HOUR_OF_DAY=0,MINUTE=0,SECOND=0,MILLISECOND=0,ZONE_OFFSET=-25200000,DST_OFFSET=0]
请帮我解决this.I需要获得日期为result.How解决这个问题。 提前致谢。