2014-12-04 71 views
0

我想在有名称的portlet横幅远程JS文件不能正常工作

对于在gatein-resources.xml中我已经declaired它作为一个shaired使用http://maps.google.com/maps/api/js与GoogleMap的名称资源,并添加GoogleMap的横幅门户

<scripts> 
    <name>googlemap</name> 
    <url>http://maps.google.com/maps/api/js</url> 
</scripts> 



<portlet> 
    <name> 
     Banner 
    </name> 
    <scripts> 
     <depends> 
      <scripts>googlemap</scripts> 
     </depends> 
    </scripts> 
</portlet> 

的依赖关系,但在加载横幅门户地图不显示。

如果我在Banner portlet中使用的
jsp文件的脚本标记中声明http://maps.google.com/maps/api/js文件,则会显示google map。

任何人都可以解释为什么googlemap js在声明在gatein-resources.xml中时没有加载。
所有其他脚本驻留在本地系统本身声明的门控资源工作正常。

回答

0

首先,模块声明中可能有错误,因为模块声明不适用于xsd schmea声明中的gatrein-resources。它应该是这样的:

<portlet> 
    <name>Banner</name> 
    <module> 
    <depends> 
     <module>googlemap</module> 
    </depends> 
    </module> 
</portlet> 

<module> 
    <name>googlemap</name> 
    <script> 
    <path>/path/to/your/js/file.js</path> 
    </script> 
</module> 

同时你应该知道,GateIn的AMD( - 异步模块defenition)引擎不会内容Delevery网络(CDN)文件提供支持,你必须提供一个路径引用您的web应用程序存档下的本地文件,而不是远程文件。

据我所知,GateIn人已计划在即将发布的版本中支持CDN路径文件。