Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JSTL parseDate and formatDate

843840Jan 7 2008 — edited Jan 7 2008
Hello I try to display a simple Date.

In my Form I have a attribute called createTime of the type java.util.Date but I don't get it to parse into a well formed String.

The code:
<c:out value="${requestScope.obj.createTime}"/>
Gives me: Fri Jan 01 00:00:00 CET 2049 That is correct. But I will get a well formed format like 01.01.2049

I try to parse this Attribute:
 <fmt:parseDate var="parse" value="${requestScope.obj.createTime}" />
<fmt:formatDate value="${parse}" />
I get the following error:
: javax.servlet.jsp.JspException: In <parseDate>, value attribute can not be parsed: "${requestScope.obj.createTime}"
The Attribute is the but I don't get it into well formed format. Can anybody help me? I think it could not be difficult to parse a standard java.util.date into da formated String with JSTL.

Thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2008
Added on Jan 7 2008
1 comment
605 views