The moose likes JSP and the fly likes <fmt:formatDate question. Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "<fmt:formatDate question." Watch "<fmt:formatDate question." New topic
Author

<fmt:formatDate question.

peter cooke
Ranch Hand

Joined: Mar 16, 2004
Posts: 295
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
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48714

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
Posts: 295
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
Bear Bibeault
Author and opinionated walrus
Marshal

Joined: Jan 10, 2002
Posts: 48714

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.
peter cooke
Ranch Hand

Joined: Mar 16, 2004
Posts: 295
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.
 
 
subject: <fmt:formatDate question.
 
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture