Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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 ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

How to check programme runs in web or standalone env?

Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing an application which will read a .properties file from filesystem. However, I encounter a problem. My application is web (.war) style so the property file usually will be stored in the e.g. WEB-INF/ or WEB-INF/classes/ folders. However, I am using maven to manage my project, so testing class in junit env, it would appear as stand alone app. Now my problem is that - how can I distinguish my application/ classes are running in web env or standalone one so that I can specify the path pointing to my property file correctly? Or is there any better to obtain property file regardless of the env the application is running?

Thanks in advice.
get schwifty. tiny ad:
the value of filler advertising in 2021
    Bookmark Topic Watch Topic
  • New Topic