Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

<fmt:formatDate question.  RSS feed

 
peter cooke
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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' />
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look at the generated HTML? Is the tag getting evaluated?
 
peter cooke
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!