• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to check programme runs in web or standalone env?  RSS feed

jason williams
Posts: 14
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!