为什么我的控制台中会出现此错误?

发布于 2024-11-04 09:15:36 字数 1847 浏览 1 评论 0原文

我刚刚注意到浏览器控制台上有一些罕见的错误消息,但我不知道原因是什么。我在我的应用程序中使用了一些 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:
enter image description here

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:
enter image description here

I dont understand why do i see those messages all the time in the console?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

醉生梦死 2024-11-11 09:15:36

如果您在页面中使用 h:head 标记,则不需要包含这些单独的 script 标记。 Primefaces 应该找出页面中使用了哪些组件,并自行输出所需的脚本。

404错误可能是由错误的绝对路径引起的。除非您的应用程序显式部署在 Web 服务器根目录,否则您需要在前面添加您的应用程序的上下文根路径。您可以使用 el 访问上下文路径,如下所示:

<script type="text/javascript"
        src="#{request.contextPath}/primefaces_resource/2.1/yui/utilities/utilities.js"></script>

If you use the h:head tag in your page then you should not need to include these separate script 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:

<script type="text/javascript"
        src="#{request.contextPath}/primefaces_resource/2.1/yui/utilities/utilities.js"></script>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文