开发者

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 pr开发者_如何学编程efix="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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜