oracle adf fusion application welcome page - java

I am new to oracle fusion development using oracle adf framework.
Well my question is that when we create a project we have two projects inside first one is model and the other one is viewcontroller.I have a made a task flow and deployed it on a jspx page.When I run the application it pops me a box for target file, is there any posibility to make a welcome file where I just start the application and the application starts with that welcome jspx page.I have also defined a jspx page in welcome file list in viewcontroller's web.xml file but it continuously asking me about the target file to run.
Any help would be highly appreciated.

In addition to Shay's comments, you can try below option also,
Go to ViewController project properties >Run/Debug/Profile option>Default configuration>Enter
appropriate page in "Default Run Target"

You can right click your specific JSPX file and run it directly.
Or alternatively when the " box for target file" pops up - just choose your JSPX file and make it the default run target.

Related

How to call a Java program from a hyperlink locally?

I have a html file, there are links in it, I wonder if there is a way to use those links to call a java program to generate another html file ?
Something like this :
<Html>
<body>
Some text
<A Href=[somehow point to a java .class file to run]>My Link</A>
More text
</Body>
</Html>
I know how to use Java to generate html, what I'm asking here is how to pass a parameter to this local java class so that it can generate html file with the input ?
So if the Java program is called : MyHtmlGen.java
Then the class will be MyHtmlGen.class
And then if I run it from the command line, it would be like this :
> java MyHtmlGen my_input
But I don't know how to turn that into the html link above ?
You could use WebStart to launch an Java application from a browser interaction.
The section of the linked documentation titled: "Running a Java Web Start Application From a Browser" provides a demo you can try. The link to the Java application is provided as:
Launch Notepad Application
That documentation states that when you click the link:
Java Web Start software loads and runs the application based on instructions in the JNLP file.
That isn't the behavior I get on Safari 7.1 on OS X 10.9 with Oracle Java 8u40 installed. Instead, I just get the jnlp file downloaded and can double click on the downloaded file to run the application. I think on some browsers, Oracle may provide a plugin to the browser which is able to launch the jnlp referenced application automatically without the user having to also double click on a downloaded jnlp file. Perhaps if the Java deployment toolkit were used, rather than a straight a href link, the user experience might be a bit more seamless.
Note: browser manufacturers have been phasing out support for plugin technology like this, so the experience or even the ability to automatically run the referenced application may vary for both you and your users. Additionally, allowing such plugins to run within a browser environment can increase the security attack vulnerability surface for a user's browser. WebStart is also quick a tricky technology to use and support for your users. So for these reasons I normally don't recommend using WebStart as a deployment solution.
That's just impossible. A link <a> will fire a GET request to the server for the URI set in the href attribute, it's not meant to execute a specific piece of code. If you want to execute code when clicking a link, use JavaScript, but be aware that JavaScript cannot start an instance of JVM and run your exact Java application.
On the other hand, maybe you should look into Applet or JavaFX and embed the java application in your page. Or probably you may submit an action to the server, and at server side you may start the JVM and execute your Java code.

click a button on html which launches a runnable JAR application? possiblE?

Originally I had an applet that contained SQL server/jdbc stuff and wanted to use that applet in html but I guess it's not good to use SQL in html? because i kept getting millions of errors/exceptions and realized my applet would only work if i commented out my SQL code.
but anyways, is there a way that I can have a button on an html page that when it is clicked it will run the runnable JAR application not the applet? without causing errors..
I'm not sure what a JAva Web Start is or what a JNLP is but if anyone could explain/help? the Oracle Website doesnt explain well enough like how do i create a JNLP?
I currently have a runnable JAR file that was exported from eclipse that opens & runs when I click the icon
You are correct that Java Web Start is what you want to use. You have your JAR file built already, so you should be good to go by following this Deploying a Java Web Start Application tutorial
This will walk you through signing the JAR file, creating JNLP file. This web site contains an example of a JNLP file, and also contains more documentation on the structure of the JNLP file here
You'll then create a few simple lines of JavaScript, to be triggered when the user clicks a button. Something like this, as mentioned in the tutorial:
deployJava.createWebStartLaunchButton(URL_TO_JNLP, '1.7.0');

Eclipse & Pivot: Launching as an applet

I'm developing an application in Java using Pivot for the GUI elements, in the Eclipse IDE.
Since the end product is supposed to be an applet, I am wondering, if there is a way to launch the application in a browser through Eclipse during the development phase.
I don't want instructions on how to write an html page that loads the libraries and jnlp or something like that, I'm only asking if there is a way to automatically do all that in one-click-mode through Eclipse.
The Run Configurations in Eclipse support launching a Java Applet.
http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.jdt.doc.user%2Ftasks%2Ftask-launching_java_applet.htm
The Hello World tutorial page on Apache's website gives you the information needed to configure the applet.
http://pivot.apache.org/tutorials/hello-world.html
[Edit in response to comment]
Open the Run Configurations Window and add a new "Java Applet". That's what the first link was meant to indicate you are able to do.
The second link provides a snippet of how you're supposed to run applets using the BrowserApplicationContext, and it's quite specific in the values you provide (and map one for one to the Eclipse launcher values):
<applet code="org.apache.pivot.wtk.BrowserApplicationContext$HostApplet"
archive="lib/pivot-core-[version].jar,lib/pivot-wtk-[version].jar,lib/pivot-wtk-terra-[version].jar,lib/pivot-tutorials-[version].jar"
width="160"
height="80"
>
<param name="application_class_name" value="org.apache.pivot.tutorials.HelloJava"> </applet>
The Main and Parameters tabs should be the only one you're looking at.

How To write a server side script using jsp and java and How to run it?

I am new to this technology, I dont no how to write a server side program and how to run before jsp page start to load. Any one can you please guide me how to do it?
Thanks in Advance,
Ver
First install a server like Tomcat and start it.
Run the examples that are available out of the box at http://localhost:8080/examples
Click on the JSP or servlet examples in the browser, and click on Execute for any one of those.
Then navigate to the examples directory on the file system under /webapps/examples/
The simple thing is to try changing the JSP code there, and start modifying the code in there to get a better hang of things.

GWT 2.0 Eclipse plugin - how to automatically launch browser on run / debug?

I've downloaded the new GTW 2.0 and it's eclipse plugin
In the new eclipse plugin, when running or debugging instead of opening the browser, it shows this:
For your convenience, here are some URLs that you may wish to view in development mode. Simply copy/paste a URL below into any supported browser.
At least they could have made the URL clickable (e.g. open your default browser) but you can only copy.
Is there a patent infringment they are trying to avoid? whats so hard in opening a browser link?
It seems they don't support it for some reason, there is no workaround, and it is the intended way.
Notice that your launch configuration
is listed in the view, along with some
suggested URLs to start up your GWT
application. Copy the URL for your
application into the browser's address
bar by selecting the entry and
choosing Copy from the context menu.
Once you have navigated to the startup
URL in your browser, you'll notice
that a browser entry will be added to
the launch configuration:
If anyone from Google reads this, it would be nice to explain why on earth you don't launch the URL?
Strange. I haven't looked at this stuff since GWT 1.8 or so, but at that time my favorite browser would pop right up when the app was launched.
I don't know exactly what's wrong in your case, but I'd check the following:
Does (double) clicking on a .html file in a file browser (Explorer or whatever you use) cause a browser to open up?
What about double clicking"Run as..." on a .jsp file in Eclipse? For me, that fires up Firefox, regardless of GWT. You may want to set up a file association in Eclipse to make this work.

Categories