VOTG
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Win a copy of JBoss AS 5 Development this week in the JBoss forum
or Spring Dynamic Modules in Action in the Spring forum!
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JSP
 
RSS feed
 
New topic
Author

<fmt:formatDate question.

peter cooke
Ranch Hand

Joined: Mar 16, 2004
Messages: 277

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 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: 35638

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

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: 35638

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

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)
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » JSP
 
RSS feed
 
New topic
replay challenge