Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/three.js/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何将null作为方法参数连接到Spring?_Java_Spring - Fatal编程技术网

Java 如何将null作为方法参数连接到Spring?

Java 如何将null作为方法参数连接到Spring?,java,spring,Java,Spring,我正在尝试使用null参数调用自定义方法。我正在尝试对元素使用arguments属性。但我的错误率越来越低。有没有办法做到这一点 <bean id="customJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="customExecutor" /> <prop

我正在尝试使用null参数调用自定义方法。我正在尝试对元素使用arguments属性。但我的错误率越来越低。有没有办法做到这一点

<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>