Author
<fmt:formatDate question.
peter cooke
Ranch Hand
Joined: Mar 16, 2004
Messages: 277
posted Jun 22, 2009 12:36:42
I am using Oracle appserver from jdeveloper 10.1.3.3
My jsp has a license object with a reference to a java.util.Date object (effectiveDate) The following line of code gives me "Effective Date: Sat Jan 01 00:00:00 PST 2005"
I am trying to format the license date to display the date in "yyyy-MM-dd" format but the following all return an empty string.
<fmt:formatDate type='both' pattern='yyyy-MM-dd' var='${license.effectiveDate}' />
or
<fmt:formatDate type='both' pattern='yyyy-MM-dd' value='${license.effectiveDate}' />
or
<fmt:formatDate value='${license.effectiveDate}' pattern='yyyy-MM-dd' />
This message was edited 1 time. Last update was at Jun 22, 2009 12:51:21 by peter cooke
CIAO Peter M. Cooke
EE5 - SCDJWS, SCBCD, SCEA part1 OCUP - Fundamental EE1.3 - scdjws, scbcd, scwcd, scjp 5 & 1.2, scea(phase1)
Bear Bibeault
Author and opinionated walrus
Sheriff
Joined: Jan 10, 2002
Messages: 36595
posted Jun 22, 2009 12:39:21
Did you look at the generated HTML? Is the tag getting evaluated?
[Smart Questions ] [JSP FAQ ] [Books by Bear ] [Bear's FrontMan ] [About Bear ]
peter cooke
Ranch Hand
Joined: Mar 16, 2004
Messages: 277
posted Jun 22, 2009 12:55:46
the HTML returns the following where I would expect to see "2006-01-05"
Interesting that it does not seem to be executing the tag
CIAO Peter M. Cooke
EE5 - SCDJWS, SCBCD, SCEA part1 OCUP - Fundamental EE1.3 - scdjws, scbcd, scwcd, scjp 5 & 1.2, scea(phase1)
Bear Bibeault
Author and opinionated walrus
Sheriff
Joined: Jan 10, 2002
Messages: 36595
posted Jun 22, 2009 12:56:43
Checking the HTML source should be a reflex when this sort of things happen.
Did you declare the fmt library on the page? Guessing not.
[Smart Questions ] [JSP FAQ ] [Books by Bear ] [Bear's FrontMan ] [About Bear ]
peter cooke
Ranch Hand
Joined: Mar 16, 2004
Messages: 277
posted Jun 22, 2009 14:11:14
Bear Bibeault wrote: Checking the HTML source should be a reflex when this sort of things happen.
Did you declare the fmt library on the page? Guessing not.
Lesson Learned. Thanks.
I have been out of the front end game for a number of years. Any other reflex's I should follow.
CIAO Peter M. Cooke
EE5 - SCDJWS, SCBCD, SCEA part1 OCUP - Fundamental EE1.3 - scdjws, scbcd, scwcd, scjp 5 & 1.2, scea(phase1)