• 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

Using property file

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello:

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/teste.properties - 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?

Thanks,
 
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic