Properties for dev and production

前端 未结 4 814
天涯浪人
天涯浪人 2021-01-06 17:12

I have a GlassFish/j2ee application, and I develop on one box, and production is a remote box. I have a function that makes files, and I need the files\' location to be diff

4条回答
  •  温柔的废话
    2021-01-06 17:51

    The easiest approach is to define a system property which specifies where the file system location for your data is. The production appserver would define one value (using java -D in the startup script), and your dev app server would define another value. Your application source would consult the system property value (using System.getProperty()) to discover the appropriate location.

提交回复
热议问题