• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Properties files in JNLP

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we add a properties file as a resource in JNLP

<jnlp>
....
<resources>
<j2se version="1.5+"/>
<jar href="client/abc.jar"/>

<!-- Is this possible -->
<jar href="client/client.properties"/>

</resources>
<application-desc main-class="MyMain"/>
</jnlp>

Or is there any other way?
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I looked in the documentation. For the <jar> element it says "Specifies a JAR file that is part of the application's classpath".

So, that answers the first part of your question, I think. For the second question: is there any other way to do what? What problem were you trying to solve with that idea?
 
Jossey Jacob
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your reply. Sorry for my late reply.

We had this config file which contains the connection-properties for the client to connect to the server.
We are using rmi over http.
So the properties are like

connection.protocol =.....
connection.port=....
connection.hostname=...
etc...


These are like defined deployment time at deployment time. So we wanted to be able to specify these properties in a file in the server. This file will not be in a jar. And we wanted this file to be downloaded to the client via java web-start.

====================
Thats the whole story in short.

Now 2 Qs,
1. What is suitable approach in this scenario?
2. Is there a way to download any other than jar, zip.. like .exe, .xml files?
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is preventing you from downloading the file at the application startup?

if(!propertiesFile.exists()){
download("http://server/propertiesFile", configurationDirectory);
}

read(propertiesFile);
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jossey Jacob:

Now 2 Qs,
1. What is suitable approach in this scenario?
2. Is there a way to download any other than jar, zip.. like .exe, .xml files?



You don't really need a properties file. You can define the properties in the jnlp file itself.

Something like this


From your application, you can retrieve these by making the call
 
Slime does not pay. Always keep your tiny ad dry.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic