primefaces gmap tag的问题

时间:2011-01-25 16:17:12

标签: primefaces

我尝试使用一个简单的gmap示例来开发webapp,但它对我不起作用。

我使用了在网页上找到的示例主要电影收藏家。我只在template.html文件中包含了此代码<p:gmap center="41.381542, 2.122893" zoom="15" type="HYBRID" style="width:600px;height:400px" />

我收到了这个错误:

javax.servlet.ServletException: /template.xhtml @39,39 <p:gmap> Tag Library supports namespace: http://primefaces.prime.com.tr/ui, but no tag was defined for name: gmap
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:325)

我认为我错了库。

另一天,我尝试使用简单的地图创建自己的示例,但我获得了相同的输出。

谢谢!

1 个答案:

答案 0 :(得分:1)

下载最新的PrimeFaces jar。 http://www.primefaces.org/downloads.html

以下内容必须在头部:

<script src="http://maps.google.com/maps/api/js?sensor=false"
        type="text/javascript" ></script>

<p:gmap>必须位于<f:view contentType="text/html"></f:view>内,才能在Chrome / Safari中呈现。

相关问题