Meaningless Drivel is fun!
The moose likes JNLP and Web Start and the fly likes Using property file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » JNLP and Web Start
Bookmark "Using property file" Watch "Using property file" New topic

Using property file

Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63

My Application use a property file, loaded to a Property class (see example). I need download this using JWS. My first attempt was use <resources>/<jar> tag:

But it did not work. When JWS launched my application, I got this message:

Bad MIME type returned from server when accessing resource: http://localhost:8080/teste/configdir/ - null

Probably JWS try downloaded this file like a binary one.
Someone suggest me to include property file in a jar file and load this in application using ClassLoader.getResourceAsStream(). But I preferred load this like a (text) File.
So my question is how download configuration or other helper files using JWS. Does JWS download only JAR files?


=================================<br /> Rafael U. C. Afonso<br /> <a href="" target="_blank" rel="nofollow"></a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
Jared Cope
Ranch Hand

Joined: Aug 18, 2004
Posts: 243

This is not a direct answer to your question, but merely another way to accomplish the same task.

I actually make use of command line arguments to specify my properties files that the application requires:

Then in the application you can go:

Doing it this way gives you more flexibility to change config settings without having to rebuild your .jars too.

Cheers, Jared.

SCJP 1.4 91%, SCJP 1.5 88%, SCJD B&S
I agree. Here's the link:
subject: Using property file
It's not a secret anymore!