Requirejs 如何将tapestry核心堆栈中的库注入或导入组件?

Requirejs 如何将tapestry核心堆栈中的库注入或导入组件?,requirejs,tapestry,Requirejs,Tapestry,我正在使用tapestry 5.4.1。我有一个需要原型的模块组件。我知道原型在核心堆栈中可用。但是,如何将其作为依赖项导入 我的模块: define(["prototype"], function(container, link) { return new Ajax.PeriodicalUpdater(container, link, { method : 'post', frequency : 5, decay : 1 }); }); 我尝试将其添加到类中,但无法解析路

我正在使用tapestry 5.4.1。我有一个需要原型的模块组件。我知道原型在核心堆栈中可用。但是,如何将其作为依赖项导入

我的模块:

define(["prototype"], function(container, link) {
  return new Ajax.PeriodicalUpdater(container, link, {
      method : 'post', frequency : 5, decay : 1
  });
});
我尝试将其添加到类中,但无法解析路径

@Import(library = {"prototype.js"})
public class Update {
尝试注入资产并将其添加到环境javascriptsupport中,但不知何故,它在错误的位置查找资产

@Inject
@Path("classpath:META-INF/assets/tapestry5/prototype.js")
private Asset prototype;

我不想用生成的哈希对url进行硬编码

/assets/meta/z67bxxxx/tapestry5/scriptaculous_1_9_0/prototype.js

我有什么遗漏吗?任何帮助都将不胜感激。

请确保在AppModule中定义正确的基础结构

@ApplicationDefaults
public static void contributeApplicationDefaults(MappedConfiguration<String, Object> configuration) {

    configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER, "prototype");
}
@ApplicationDefaults
公共静态void contributeApplicationDefaults(MappedConfiguration配置){
添加(symbolstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER,“prototype”);
}

您不必明确指定依赖关系[“prototype”]。

prototype已经可用。你认为问题出在圣经里吗?默认的提供者是prototype,我在任何时候都不会将其更改为jquery。我认为您不能直接使用prototype,只能使用tapestry包装:(function(){define([“t5/core/dom”,“t5/core/events”,“t5/core/console”,“t5/core/ajax]”),function(dom,events,console,ajax){});
@ApplicationDefaults
public static void contributeApplicationDefaults(MappedConfiguration<String, Object> configuration) {

    configuration.add(SymbolConstants.JAVASCRIPT_INFRASTRUCTURE_PROVIDER, "prototype");
}