Java 如何将null作为方法参数连接到Spring?
我正在尝试使用null参数调用自定义方法。我正在尝试对元素使用arguments属性。但我的错误率越来越低。有没有办法做到这一点Java 如何将null作为方法参数连接到Spring?,java,spring,Java,Spring,我正在尝试使用null参数调用自定义方法。我正在尝试对元素使用arguments属性。但我的错误率越来越低。有没有办法做到这一点 <bean id="customJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="customExecutor" /> <prop
<bean id="customJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="customExecutor" />
<property name="targetMethod" value="run" />
<property name="arguments">
<null/>
</property>
</bean>
我的CustomExecutor类方法
public void run(Object object){
....
}
请尝试以下代码:
<bean id="customJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="customExecutor" />
<property name="targetMethod" value="run" />
<property name="arguments">
<property name="arguments">
<list>
<null/>
</list>
</property>
</bean>
尝试以下代码:
<bean id="customJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="customExecutor" />
<property name="targetMethod" value="run" />
<property name="arguments">
<property name="arguments">
<list>
<null/>
</list>
</property>
</bean>