File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes How to make a JNLP file take dynamic parameter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "How to make a JNLP file take dynamic parameter" Watch "How to make a JNLP file take dynamic parameter" New topic
Author

How to make a JNLP file take dynamic parameter

Ket Nonting
Greenhorn

Joined: Aug 09, 2011
Posts: 20
Hi,
This JNLP snippet from Oracle tutorial web site takes static parameters from the admin commands.

I'm wondering if it could take parameters from user input like string variables.

To make it clear, my applet would take variables from user input and display those values on the display panel.

I've no problem with a normal applet, it works fine. But how do I make the JNLP file does the same.
My normal applet's approach is:

It's triggered by javascript.

Thanks in advance
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

You will recall that a JNLP file is downloaded from the server. So the server would have to generate the JNLP file and set the parameter appropriately.
Ket Nonting
Greenhorn

Joined: Aug 09, 2011
Posts: 20
Thanks Paul,

Can you please elaborate a little more. I do not understand this.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
The JNLP could be generated by a JSP (or PHP) page which takes user input through an HTML form submit.
Ket Nonting
Greenhorn

Joined: Aug 09, 2011
Posts: 20
Thanks Tim,
Here's my PHP file, which works fine for a normal applet:


Here the javascript to trigger a JNLP file


and the JNLP file

So how do make the JNLP file take string parameter? It would work just fine if I do it like this:
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
I'm not sure what you're asking - where do you see the difference between the page with the explicit applet tag and the one with the JNLP applet? Both can easily be served by PHP, and would get the value of the "random" string in the same way, in whichever way that works.
Ket Nonting
Greenhorn

Joined: Aug 09, 2011
Posts: 20
The problem is here:

<param name='String' value='images/random/' .$random. '.jpg'>

On the JNLP file. It does not work. This is the only line I struggle with.
Ket Nonting
Greenhorn

Joined: Aug 09, 2011
Posts: 20
YEEEEHA! I solved it.

this thing stupid
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to make a JNLP file take dynamic parameter
 
Similar Threads
Adding/changing java classes on eclipse project
Java console launched twice
How can I access System Properties to determine a param-value for a context-param in Web.xml?
Using Server Installed JRE For JNLP
Basic concept in Applet-Servlet communication ?