aspose file tools*
The moose likes JSP and the fly likes JSTL: $Math.random() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSTL: $Math.random()" Watch "JSTL: $Math.random()" New topic
Author

JSTL: $Math.random()

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
This is always false


What is the correct syntax?


comp.lang.javascript FAQ: http://jibbering.com/faq/
vidya archana
Ranch Hand

Joined: Oct 29, 2002
Posts: 36
Try this
<c:when test='${Math.random() ge .5}'>

Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
When using
I get the error message "encountered '('"
With
The test is always false.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
Why is ${Math.random ge .01} always false?
It should be true 99% of the time.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
.
Garrett Smith
Ranch Hand

Joined: Jun 27, 2002
Posts: 401
^
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSTL: $Math.random()
 
Similar Threads
random colour problems
java graphic problem
Random Method
Algorithm to generate random token ids.
Generating random numbers