Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在 GREL 中生成随机数。有没有办法做到这一点?我想使用 GREL 短语,例如:
“ http://example.org/id/ ” + 随机 + “.html”
GREL 没有random功能,但您可以使用 Python/Jython 代替:
random
import random # return a random integer between 0 and 1000 return value + str(random.randint(0, 1000)) + ".html"
例子 :