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().
Related
I'm very new on Java Web dev. On intellij Idea 14, I started a new project with plain Java, JSF support (no JavaEE, will add Spring later). Tomcat 7.0.59 as server. When I hit run on the IDE, firefox opens up and hits on 'http://localhost:8080/index.xhtml', it should display the hello world in index.xhtml that the IDE makes on new project, but the page just displays 'HTTP 404'.
I think the problem is path on the browser, how can I find the correct path and configure it on IDE deploy settings?, how can I debug on tomcat?, where can I start looking?
http://localhost:8080/index.xhtml is an incomplete address. Where is the context root? It should be the name of your project/webapplication, where you would have
"http://localhost:8080/{application-name}/index.xhtml".
Unless you've set your application to be the default tomcat application (which I highly doubt), you should have the name of your project in there in the URL
%CATALINA_HOME% is Tomcat install directory. Use %CATALINA_HOME%\logs to read Tomcat log for debugging.
When you create a new Java web project, It also means you are diving to Java EE (Enterprise Edition).
Create new JSF web application by IntelliJ IDEA:
Offical tutorial for you: http://docs.oracle.com/javaee/7/tutorial/partwebtier.htm#BNADP .
You should use GlassFish 4 application server for simplicity at first one.
move the lib directory into WEB-INF
I'm learning Java EE and it appear to me that One of the things to Know is JSF
I'm also sing cloudControl but I haven't found a Way to Deploy a JSF Applications there.
Is there a way of deploying a JSF Applications on cloudControl ?
As mentioned in the comment, you need to provide some implementation of JSF as a dependency together with embedded jetty or tomcat runner. Here you can find some example apps for tomcat and jetty. Maybe it would be also helpful for you to have a look on our existing java guides.
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.
I am having an application which was developed using JSF 1.1 components. The tag libraries development team, is not going to support JSF 1.2, and we have to run the application on Webshere 7. As websphere 7, by default comes with JSF 1.2. Initially, i was able to deploy my application, but was unable to access it. Later, I read somewhere to remove "Precompile JSP" option, i did that and i was able to access the application. But i am facing some weird thing, first time i am able to login to application, but if i logout and then tries to login again, it is giving exceptions. The exception is javax.faces.el.EvaluationException: Exception while invoking expression #{login.authenticate}, where login is my bean name and authenticate is the method. Moreover, I want some other way, so that i should keep "Precompile jsp" option selected. I read somewhere about shared libraries, but not aware how to actually implement that. My war file contains jsf-api.jar and jsf-impl.jar of JSF 1.1.
Do you see some errors regarding propertyLoader? I had similar problem, and removed from config file custom propertyLoader (left standart), and it became almost ok.
I have done some work with JSF(using netbeans as the IDE) and within your jsp/xhtml file you get code on beans/resource bundles that your have defined.
ATM I am investigating struts2 and seem to be unable to get similar functionality in the IDE. Is this just the case with the IDE or do I need to define something?
Thanks
So, you basically just want a Struts plugin for Netbeans? As the link reveals, there are several, even that there's already one built-in in Netbeans 6.7 or newer.