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!

Custom Tag to Convert String to Date Variable

843838Jan 31 2006 — edited Feb 1 2006
Greetings,

Does anyone know of a custom tag which converts a String to a Date variable?

I am retrieving a String from a bean, format dd/MM/yyyy and passing it to a tag which formats it for output. But so far I haven't been unable to avoid putting a real-time expression to do a Date conversion first:

<fmt:formatDate type="date" value='<%=new Date((String)(pageContext.getAttribute("myBeanDatePropertyAsAString"))) %>' pattern="EEEE d MMMM yyyy"/>

Surely there must be a better way which avoids putting Java into my tag?

Thanks,

Lloyd
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 1 2006
Added on Jan 31 2006
4 comments
364 views