• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

Properties files in JNLP  RSS feed

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • 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: 24464
55
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • 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
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
ScroogeXHTML - small and flexible RTF to HTML converter library
https://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!