我正在使用 XML 配置定义一个 Apache 骆驼路由,我想在使用单引号传递参数时调用一个方法:
<bean ref="cmdExecutor" method="execute('BatchQA.bat',
'./input/CamelCMDFile/QATestScripts/', 'Analytics,'qa.user'')"/>
execute 方法如下所示:
public int execute(String bat, String dir, String arguments, Exchange exchange) {
String[] args = arguments.split(",");
result = ProcessUtils.cmdExecute(bat, dir, args);
.....
我曾尝试使用', ' and '来获得所需的结果,但都没有奏效。这些字符在arguments对象中被简单地忽略,字符串的其余部分在我的 java 函数中被接收。
应用@Screwtape 解决方案后,我得到了争论'qa.user',这不是我的目标。
慕桂英4014372
相关分类