AndroidHustle
AndroidHustle

Reputation: 1814

c:out JSTL tag doesn't work for me

I've just recently been trying to get into JSTL and I'm experiencing some problems with it..

This is a tag in my hello.JSP:

<p>Greetings, it is now <c:out value="${now}"/></p>

And it's supposed to display the current time, but the output that I do get is:

Greetings, it is now ${now}

The tag is written from a SpringSource tutorial so it should be correct, but the logic seems to be skipped... don't know why this is. I have the jstl.jar in a reference library and

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

is implemented in a separate JSP-file header that is included in the hello.JSP file.

If you haven't guessed I'm a total noob in this environment so the solution may be very simple. If anyone could give me some pointers on what the problem might be I would greatly appreciate it!

Best regards -Max

Upvotes: 0

Views: 2246

Answers (1)

Ray Toal
Ray Toal

Reputation: 88388

In JSTL, now is not a predefined variable.

In the SpringSource docs you are reading you might have missed where they assigned the variable now a value like new Date(), most likely in a <c:set> tag. I'm sure you'll find it.

Upvotes: 2

Related Questions