質問

I'm trying to configure CometD in my web application. This web application is the client of CometD, it uses JSF 2.0, primefaces 3.3.1 and run on glassfish. In this application this global var is undefined:

var cometd = $.cometd;

Probably the source of my problem is the linkage of javascript libraries:

<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/jquery-1.7.2.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/json2.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/org/cometd.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/jquery/jquery.cometd.js"></script>

I know this is JSP way to import javascript files, but I simply don't know which path to use for h:outputScript...

PS. I just added this dependency for this module:

 <dependency>
        <groupId>org.cometd.javascript</groupId>
        <artifactId>cometd-javascript-jquery</artifactId>
        <version>2.4.3</version>
        <type>war</type>
 </dependency>
役に立ちましたか?

解決

It was my fault, I didn't see that maven archetype created all javascripts files in a directory of the project...

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top