Math.Radmom with JSTL?

T

tim.enloe

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:eek:ut value="${Math.random}" />


The standard way works just fine
<%= Math.random() %>

Thank you,

Tim
 
A

Andrew Thompson

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:eek:ut value="${Math.random}" />

Have you imported java.util.Math into the page?
Are you trying to access the Math.random attribute?
(...)

Andrew T.
 
V

vic

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:eek:ut value="${Math.random}" />

This will actually try to call a Math.getRandom(), which does not exist.

vic
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Need help with a script... (my first!) 6
JSTL attempt in JSP 5
JSTL config question 10
JSTL Question 10
JSTL c:out not printing value 5
page counter in JSP & JSTL 0
jstl ? 0
Problem with forEach in jstl 0

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,135
Latest member
VeronaShap
Top