为什么我的控制台中会出现此错误?
我刚刚注意到浏览器控制台上有一些罕见的错误消息,但我不知道原因是什么。我在我的应用程序中使用了一些 primefaces 小工具,一切正常,但是当我从一个页面导航到另一个页面时,我不断在控制台中看到这一点:
我不知道出了什么问题。我只想提一下,我的所有页面都使用同一个模板,该模板具有您在上图中看到的导航小工具。在该模板的 head 标签中,我添加了以下脚本:
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/utilities/utilities.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/datasource/datasource-min.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/primefaces/paginator/paginator.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/datatable/datatable-min.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/primefaces/datatable/datatable.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/swf/swf-min.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/charts/charts-min.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/primefaces/charts/charts.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/jquery/jquery.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/primefaces/core/core.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript" ></script>
这是我添加到类路径中以便能够使用 primefaces 的 jar:
我不明白为什么我总是在控制台中看到这些消息?
I just noticed some rare error messages on my browser console, but i don't know what is the reason. I use some primefaces gadgets in my app, it all works fine, but when i navigate from one page to another i keep see this in the console:
I don't know what is wrong. I just want to mention that all my pages use one same template, that has the navigation gadget you see in the image above. In that template at the head tag i added this scripts:
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/utilities/utilities.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/datasource/datasource-min.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/primefaces/paginator/paginator.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/datatable/datatable-min.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/primefaces/datatable/datatable.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/swf/swf-min.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/yui/charts/charts-min.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/primefaces/charts/charts.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/jquery/jquery.js"></script>
<script type="text/javascript"
src="/primefaces_resource/2.1/primefaces/core/core.js"></script>
<script src="http://maps.google.com/maps/api/js?sensor=false"
type="text/javascript" ></script>
This is the jars i added to my classpath to be able to use primefaces:
I dont understand why do i see those messages all the time in the console?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您在页面中使用
h:head
标记,则不需要包含这些单独的script
标记。 Primefaces 应该找出页面中使用了哪些组件,并自行输出所需的脚本。404错误可能是由错误的绝对路径引起的。除非您的应用程序显式部署在 Web 服务器根目录,否则您需要在前面添加您的应用程序的上下文根路径。您可以使用 el 访问上下文路径,如下所示:
If you use the
h:head
tag in your page then you should not need to include these separatescript
tags. Primefaces should figure out which components are used in the page and output the needed scripts itself.The 404 error are probably caused by a wrong absolute path. Unless your application is explicitly deployd at the webserver root, you need to prepend the context root path of your. You can access the context path using el like this: