Hi, I'm trying to output a random number using Math.random with JSTL
but it isn't working. Is there something wrong with this syntax?
<c:out value="${Math.random}" />
The standard way works just fine
<%= Math.random() %>
Thank you,
Tim
Andrew Thompson - 04 Aug 2006 06:59 GMT
> Hi, I'm trying to output a random number using Math.random with JSTL
> but it isn't working.
No? Maybe it is just lazy. Did you try cash
inducements, threats, ..counselling?
>..Is there something wrong with this syntax?
>
> <c:out value="${Math.random}" />
Have you imported java.util.Math into the page?
Are you trying to access the Math.random attribute?
(...)
Andrew T.
vic - 04 Aug 2006 14:08 GMT
> Hi, I'm trying to output a random number using Math.random with JSTL
> but it isn't working. Is there something wrong with this syntax?
>
> <c:out value="${Math.random}" />
This will actually try to call a Math.getRandom(), which does not exist.
vic