1

豆类.xml

<bean id="duke" class="Juggler">
    <constructor-arg value="#{T(java.util.Random).nextInt(10)}"/>
</bean>

例外:

原因:org.springframework.expression.spel.SpelEvaluationException: EL1004E:(pos 20): Method call: Method nextInt(java.lang.Integer) can not be found on java.util.Random type

4

2 回答 2

1
"value=#{ new java.util.Random().ints(1, 0, 10).sum() }"

特殊文档

于 2017-02-09T18:55:14.027 回答
-2

可能这样你只能调用静态方法

于 2016-10-29T21:41:49.500 回答