How to open a Java Web Start Application from a Hyperlink in a JavaFX 2.0 Application - javafx-2

I have a web application that loads other applications from within it, how can I open a java web start application from within my JavaFx 2.0 application. All help is greatly appreciated.

It's long to answer, you need to study how to Deploy Java Web Start application first.
The basic approach is:
Create a JAR file containing your application's class files and resources. including Main-Class attribute in your MANIFEST.MF.
Create JNLP files to describe how your application to run, You can also use JavaFX Packager tool to help.
Then look at source code for The Java FX Ensemble example to figure out JavaFX specific configuration, and full documentation Deploying JavaFX Applications.

Related

Is it possible to deploy JSF application on Bluemix?

I have installed IBM Bluemix tools on Eclipse and created a 'Hello World' JSF and EAR project. While creating I have chosen a Bluemix runtime environment. Now I try to deploy EAR from Eclipse, it successfully deployed and started but when I try to open it I get the following error:
Not Found The application or context root for this request has not been found: [Ljava.lang.Object;#bdb04149
What have I missed? Is there comprehensive tutorial to deploy Java EE web applications on Bluemix available anywhere?
You can deploy complete EAR files on Bluemix yes. Using the eclipse tools also makes it much easier. This link has steps on how you can do this https://www.ng.bluemix.net/docs/#manageapps/eclipsetools.html
Further down the page (you can use the menu on the left too) there are steps on how to push an EAR. It might be with pushing a complete Liberty profile to get finer control on the application behavior. This link has further details on pushing Liberty apps and the profile itself https://www.ng.bluemix.net/docs/#starters/liberty/index.html#liberty
If you deployed an EAR (containing your JSF app) you need to add the web module name to the URL, for example, if your project is called testJSF, your URL will look like this:
http://testApp.mybluemix.net/testJSF/
And of course, if your web page is not called index.xxx you need to add the web page name as well, for example:
http://testApp.mybluemix.net/testJSF/textPage.xhtml
or
http://testApp.mybluemix.net/testJSF/textPage.faces

JavaFX, embedded application in jsf page is slower than standalone

I am working about embedding a JavaFX GUI in a web application and I have this issue: the application launched standalone without using the jnlp file is faster than when it is launched by the web application using the jnlp file.
Some details:
The jvm is the last stable 1.7u40
All (also the application server) is running on my pc
All used jars are signed by a certificate I signed using a CA created by my self using keytool.
I set <update check="always" policy="always"/> on the jnlp file
The download policy of jars on jnlp file is lazy
On the web I found nothing useful or explaining this behaviour. My suspect is that the jnlp start my application and something more, I will do some check about this.
I am open to any suggestions.
Thank you
Update
I found that the JavaFX GUI is slow only if it is embedded in the web page: if I call from the web page dtjava.launch(that executes the jnlp standalone) instead of dtjava.embed(that embeds the GUI in the page) all seams to work quite good.
The question persists why is it slower embedded?

dyploying javafx on web

I want to build set of tools for my team and they will be as part of JavaFX application for which GUI will be build with help of SCENE BUILDER. I have seen everything that was available but I need an example how to embed this type of application on the server from which it can be invoked somehow. Please help with examples and links. I'd like to make it look as this one. http://download.oracle.com/otndocs/products/javafx/2.2/samples/Ensemble/index.html
Thank you.
Place a copy of the jar, jnlp and html file output by the NetBeans JavaFX project build or JavaFX packaging tools deploy command into a directory of your webserver, then access the html file in your browser.
For example, let's say you called your application MyPowerApp and netbeans output MyPowerApp.html and you wanted to deploy that to a local Tomcat server:
Download and install a copy of Tomcat
Copy the jar, jnlp and html file into tomcat's webapps/ROOT directory.
Start tomcat.
Access your application via http://localhost:8080/MyPowerApp.html
The applet will start automatically and you can click on the link to launch the application via WebStart.
To update the application just rebuild it in NetBeans, copy it over into the tomcat webapps/ROOT directory and refresh your browser link (no need to restart Tomcat).
In practice you will want to modify the html rather than use the generated html to embed either the applet or WebStart link somewhere on your website (you won't need both execution modes in a single page like the Netbeans generated sample).
You may need to sign your application if it refers to needs permissions outside of the jnlp application sandbox.
To get the application to fill a browser window like Ensemble, it's height and width need to be set to 100% and the HTML page template modified to not have any page margins (view source on the Ensemble page for a sample).
You can include your fxml in your application jar and load it from there or you can load it off your server relative to your application deployment directory.
The information above is a variation of my forum answer on deploying JavaFX web applications to a server.
See the JavaFX deployment guide and Ensemble sample application source for more info.
deployment guide
deployment QuickStart
ensemble sample application
JavaFX sample application source at the JavaFX demos and samples link

run an external process from jsf / glassfish

This is a jsf 2.0 project on GlassFish 3.1.2, developed with Netbeans.
In my business logic, I need to launch a perl application which returns a png or svg. This file will be displayed or presented as a file download in the UI (for which I will use primefaces).
Question: How can an external process like this perl script be launched from my jsf app?
(I have found a thread on this issue here: http://www.java.net/node/676943 but the answer was too technical, I could not understand it)
Thx!
You can use Runtime.getRuntime().exec("perl script.pl") or you can use Process class.
Look at exitValue() and getInputStream().

Integration of Java application with OpenCms

I want to know how to integrate a Java web application with OpenCms contents. Is it possible to integrate a Java application with OpenCms?
Yes, it's possible. For example you can integrate SpringMVC or Struts into OpenCms, or other tools like JForum, an open source java forum, which also supports single-sign-on (SSO).
You can find information here & a small sample OpenCms+Spring integration project:
http://www.opencms-wiki.org/wiki/Integration_HOWTOs
Since OpenCms is open source and based on Java EE standards, you are pretty free.
What I have done successfully is to create a jstl tag library to connect JSPs in OpenCms to a business backend.
In my case it was done through a SOAP web-service.
Another advantage of this was that I could test and develop my code in Eclipse, without a dependency on OpenCms.
Deploying to production would then mean to deploy a jar file to the OpenCms webapp.
Yet another advantage: Since we put some of the view-logic into the OpenCms-hosted JSPs, they were versioned by OpenCms.
We have integrated SprigMVC into an existing OpenCMS installation. Here is a description of how we went about that: http://blog.shinetech.com/2013/04/09/integrating-springmvc-with-opencms/

Resources