【问题标题】:How to create parameters for e4 commands如何为 e4 命令创建参数
【发布时间】:2015-10-20 12:37:57
【问题描述】:

我正在开发一个尝试将参数传递给命令的 e4 应用程序。 我在应用程序模型中定义了参数,因此它们是字符串。 我省略了参数的 typeId。

Map<String, Object> parameter = new HashMap<String, Object>();
parameter.put("de.mdsd.e4.rap.kdn.joggathon.webeditor.commandparameter.username", username);
parameter.put("de.mdsd.e4.rap.kdn.joggathon.webeditor.commandparameter.password", password);
ParameterizedCommand cmd = commandService.createCommand("command.dologin", parameter );

当我创建传递参数的命令时,我返回 null,因为 commandService 没有为我的参数找到转换器。

我必须在参数中指定哪个 typeId 才能使简单的字符串参数正常工作?

【问题讨论】:

标签: parameters command e4


【解决方案1】:

如果“username”和“password”来自String 类型,您的版本非常好。该错误可能在其他地方产生。 您可以在填写地图之前尝试parameters.clear();,以避免意外映射。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-26
    • 1970-01-01
    • 1970-01-01
    • 2021-09-13
    • 1970-01-01
    • 1970-01-01
    • 2020-08-25
    相关资源
    最近更新 更多