【发布时间】:2026-01-09 23:15:01
【问题描述】:
我用几个参数调用render(),其中第一个是我作为参数得到的String 参数:
公共静态无效动作(字符串网址){ ...
渲染(网址,...); }
我收到此错误:
The template http://the.contents.of/urlParameter does not exist.
现在,我正在通过render() 进行调试,在那里我看到了这个 sn-p:
protected static void render(Object... args) {
String templateName = null;
if (args.length > 0 && args[0] instanceof String && LocalVariablesNamesTracer.getAllLocalVariableNames(args[0]).isEmpty()) {
// I'm getting into this branch
templateName = args[0].toString();
} else {
templateName = template();
}
renderTemplate(templateName, args);
}
if 试图完成什么?为什么我要进入它 - 是因为我没有为 url 使用局部变量吗?这有记录吗?这是什么原理?
我使用的是 1.2.x-c40cf37 版本(在 1.2.4 之后的某个地方)。
【问题讨论】:
标签: java controller playframework