javascript 变量“Spring”在哪里?在 spring webflow 中定义?
我正在使用 spring webflow,我的页面出现以下错误:
Spring is not defined
Spring.addDecoration(new Spring....entId:'proceed', event:'onclick'}));
我想知道在 spring 框架中定义的 javascript 变量 Spring
在哪里。我使用的是maven,那么我应该添加什么依赖项呢?
I am using spring webflow, my page got the following error:
Spring is not defined
Spring.addDecoration(new Spring....entId:'proceed', event:'onclick'}));
I am wondering where is javascript variable Spring
defined in spring framework. I am using maven, so what dependency should I add in?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
基本 Maven 依赖项:
这将包括此传递依赖项:
其中包含 JavaScript 资源:
资源:
META-INF/web-resources/spring/Spring.js< /code>
如果您按照指定配置 Spring MVC,则可以提供服务 此处:
Base Maven Dependency:
This will include this transitive dependency:
Which contains the JavaScript resources:
Resource:
META-INF/web-resources/spring/Spring.js
Which you can serve if you configure Spring MVC as specified here:
我在 Spring Roo 中遇到了这个问题,结果发现问题与 load-scripts.tagx 文件中对 dojo 和 spring 脚本的引用有关。语法应如下所示:
如果您重新格式化以将注释放在行上方,则 spring.js 永远不会在运行时包含,因此这就是您看到“Spring.addDecoration is undefined”的原因。
在这一点上,我不知道为什么 tagx 对此如此挑剔。
I was having this issue in Spring Roo and it turned out the problem was associated with the references to the dojo and spring scripts in the load-scripts.tagx file. The syntax should be as follows:
If you reformat to put the comments above the lines, then the spring.js is never included at runtime and so that's why you see 'Spring.addDecoration is undefined'.
At this point, I'm not sure why the tagx is so picky about this.
这个问题解决了。首先,必须按照Sean所说添加配置。然后导入以下js。
我没有在我的 webflow 中使用tiles,webflow 的示例使用tiles 并导入standard.jsp 中的三个js 文件,这就是为什么我应该在每个jsp 文件中显式导入js 文件。
This issue resolved. First of all, must add configuration as Sean said.Then import the following js.
I did't use tiles in my webflow, the example of webflow using tiles and import that three js files in standard.jsp, that why I should import js files explicitly in every jsp file.