cometd javascript path to use with h:outputScript - jsf-2

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...

Related

D3/Nivo is unable to render in rails application

I am working on a feature to replace a Flash dashboard with Nivo/D3. I successfully built the dashboard and have it as a React component to be imported. The react component even loads into the browser, but does not render on the page.
I have verified that my component is built correctly, and I am able to run it in an html page by itself. The page I am trying to put it in is of file type .html.erb. I did try changing the ruby tags to HTML and that did not work. One theory is that I need to remove the JS prototype duplicate line here.
<script type="text/javascript"> </script>
<script src="/javascripts/prototype.js?1557137208" type="text/javascript"></script>
<script src="/javascripts/prototype.js?1557137208" type="text/javascript"></script>
<script src="/javascripts/effects.js?1557137208" type="text/javascript"></script>
<script src="/javascripts/dragdrop.js?1557137208" type="text/javascript"></script>
<script src="/javascripts/controls.js?1557137208" type="text/javascript"></script>
<script src="/javascripts/application.js?1557137208" type="text/javascript"></script>
<script src="/javascripts/active_scaffold/default/active_scaffold.js?1565285086" type="text/javascript"></script>
<script src="/javascripts/active_scaffold/default/dhtml_history.js?1565285086" type="text/javascript"></script>
<script src="/javascripts/active_scaffold/default/form_enhancements.js?1565285086" type="text/javascript"></script>
<script src="/javascripts/active_scaffold/default/rico_corner.js?1565285086" type="text/javascript"></script>
<link href="/stylesheets/active_scaffold/default/stylesheet.css?1565285086" media="screen" rel="stylesheet" type="text/css" />
<link href="/stylesheets/active_scaffold/default/export-stylesheet.css?1565285086" media="screen" rel="stylesheet" type="text/css" />
<!--[if IE]><link href="/stylesheets/active_scaffold/default/stylesheet-ie.css?1565285086" media="screen" rel="stylesheet" type="text/css" />
<link href="/stylesheets/active_scaffold/default/export-stylesheet-ie.css?1565285086" media="screen" rel="stylesheet" type="text/css" /><![endif]-->
However, I don't know where or how that code is being generated. I think it is related to active scaffolding. Does anyone have any input on that?
Presently, the error message I have been troubleshooting is this:
index.esm.js:214 Uncaught TypeError: h(...) is not a function
at Object.<anonymous> (index.esm.js:214)
at n (ResizeObserver.es.js:928)
at Object.<anonymous> (index.esm.js:214)
at n (ResizeObserver.es.js:928)
at Object.<anonymous> (index.esm.js:214)
at n (ResizeObserver.es.js:928)
at Object.<anonymous> (index.esm.js:214)
at n (ResizeObserver.es.js:928)
at Module.<anonymous> (index.esm.js:214)
at n (ResizeObserver.es.js:928)
but I don't think that is relevant as I have dug into it quite a bit.
Tech stack notes (I realize I am on an old version of Ruby but upgrading is unfortunately not an option):
* XML Version 1.0
* Ruby version: 1.8.6
* Ruby gems
cgi_multipart_eof_fix (2)
gem_plugin (0.2.3)
* json_pure (1.7.6)
* mongrel (1.1.5)
* rake (0.8.7)
* ruby-net-ldap (0.0.5)
* Apache version: Not used yet. Eventually Odin and Sonitor will be replaced with nifi.
* .NET version 4.0 (or 4.7)
Does anyone have advice on how to get my React component to render?

Missing files (404) in Ionic App only in iOS

I have an app I developed in Android. I installed a VM with Mac, and I'm testing it in iOS. The app worked perfectly in Android, but in iOS it is not. When I use 'ionic serve' or 'ionic serve --lab' the browser show a white screen, and in the console I get this errors (link of image below):
Console
Here is some code from the index.html:
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="lib/ionic/css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/bluebird.min.js"></script>
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ionic.cloud.min.js"></script>
<script src="lib/ionic/js/ionic-modal-select.min.js"></script>
<script src="lib/ionic/js/ionic-toast.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="js/ng-cordova.min.js"></script>
<script src="cordova.js"></script>
I'm really lost here because the exact same files works OK for Android.
Which error you are posted, not library error.Error coming from app.js file.If you dont mind create a new ionic app and replace your file in new app.it will works.

grails 2.4 - jquery not being included

I'm trying to do the example from the Manning "Grails in Action": the gsp's
<g:javascript library="jquery" />
is becoming
<script src="/qotd/js/jquery/jquery-1.11.1.js" type="text/javascript" library="jquery"></script>
but that URL doesn't work. BuildConfig.groovy has
plugins {
//...
runtime ":jquery:1.11.1"
I might have missed a step in typing things in, or it might be a 2.3->2.4 Asset issue?

Phonegap / iOS - Unable to make inAppBrowser work

I've trying for some days to get inAppBrowser to work in a simple Phonegap App for iOS with no luck.
Nothing happens... No log con the console.log...
What I've done so far is:
Install inAppBrowser using: plugman --platform ios --project /path/to/app --plugin inappbrowser
If I try to install it using
phonegap plugin add
https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git
it says it's already installed, so I assume installation is OK.
Add the plugin call in the main config.xml file this way: <gap:plugin name="org.apache.cordova.inappbrowser" version="0.2.4" />
My index.html file looks like this:
<!DOCTYPE html>
<html>
<head>
<title>InAppBrowser Example</title>
<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>
<script type="text/javascript" charset="utf-8">
// Wait for Cordova to load
//
document.addEventListener("deviceready", onDeviceReady, false);
// Cordova is ready
//
function onDeviceReady() {
var ref = window.open('http://apache.org', '_blank', 'location=yes');
}
</script>
</head>
<body>
Hello World
</body>
</html>
I understand, on launch, it should open the Apache home, or stay blank (because of Phonegap URL permissions), but it just shows up the "Hello World" text and nothing happens.
Any ideas of what am I doing wrong?
Thanks in advance, and sorry about my poor english!
Make sure you have the following in your config.xml:
I used to have org.apache.cordova.InAppBroweser - maybe from an older version and it caused issues.
Also make sure your config.xml (in your apk file) is created properly.

Should web components be placed under "web" folder?

Is the purpose to place web components under the web folder somewhere, or under the lib folder?
I'm asking because I'm unsure and it's not mentioned as far as I can tell.
Put your components under the lib directory.
lib/
control1.html
control2.html
control3.html
Let's say you configure your pubspec.yaml file and name your package 'my_controls'.
name: my_controls
dependencies:
html5lib: '>=0.3.1+2'
web_ui: '>=0.3.2'
Since your project now defines a package, you can reference files in your lib directory as:
<link rel="components" href="packages/my_controls/control1.html">
<link rel="components" href="packages/my_controls/control2.html">
<link rel="components" href="packages/my_controls/control3.html">
You can point to components:
<link rel="components" href="component/ui/login.html">
in which case your components are in web/component/
and in web/component/ui/
you have the login.html file

Resources