Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL fmt with formatDate problem  RSS feed

 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all, I'm having trouble formatting dates in my jsps.

I have a ref to the taglib which is..

<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>

and to show a date I have...

<fmt:formatDate value="${now}" type="both" dateStyle="full" timeStyle="full"/>

However I always get the error message...

According to TLD or attribute directive in tag file, attribute value does not accept any expressions.



any ideas anyone ?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of JSP are you using?
[ October 19, 2005: Message edited by: Bear Bibeault ]
 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm whats the easiest way to find that out, I use tomcat 5.5.7 along with Netbeans v5 beta for dev and JDK 1.5 so I thought I'd have the latest of everything.. Hmmm
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>According to TLD or attribute directive in tag file, attribute value does not accept any expressions.

This is the standard error message you get when you try to use JSTL1.0 with a JSP2.0 container.
In Tomcat5 you should be using JSTL 1.1
This has the uri: <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
Note the subtle difference with the addition of the "/jsp" in there.

Try that instead of your current one, and see what happens.
If it complains it can't find that taglib, you need to download JSTL1.1

Useful links:
http://faq.javaranch.com/view?JstlTagLibDefinitions
http://faq.javaranch.com/view?ServletsWebXml
 
Dave Brown
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OOoooo thats a nasty one to spot....

Thanks a lot , that solved it..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!