简体   繁体   English

如何在Vaadin 6.8上加载外部javascript文件?

[英]How to load external javascript file on Vaadin 6.8?

I am using Vaadin 6.8 and need to load external javascript resource, but Vaadin of version 6.8 does not support @JavaScript annotation. 我正在使用Vaadin 6.8,并且需要加载外部javascript资源,但是6.8版的Vaadin不支持@JavaScript注释。

I have also tried Vaadin's CustomLayout, it loads html page, but does not execute javascript in that html under <script> tag? 我也尝试过Vaadin的CustomLayout,它可以加载html页面,但是不能在<script>标记下的html中执行javascript?

Any other solutions on Vaadin 6.8? Vaadin 6.8上还有其他解决方案吗?

Override method called writeAjaxPageHtmlHeader in your servlet class. 覆盖servlet类中称为writeAjaxPageHtmlHeader的方法。 You can there add any html to the head part of the "host page". 您可以在那里将任何html添加到“主机页面”的开头。 See AbstractApplicationServlet for other extension points if you want to add it to for example body part. 如果要将其添加到例如主体部分,请参见AbstractApplicationServlet以获取其他扩展点。

https://dev.vaadin.com/svn/versions/6.8/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java https://dev.vaadin.com/svn/versions/6.8/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM