This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Production code and Development code/settings must different

Charles Roos
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My project has a XML file "", that needs to have different content for Production environment and different content when in Development mode. How can i achieve that?

I understand that Java does not have pre-compiler directives (like #ifdef and others). But if Java had such possibility i would do in file "" so:

#ifdef Production Then

decisionIType.(class) =
decisionIType.contentType = application/pdf;charset=UTF-8
decisionIType.stylesheetLocation = file:\\\C:\\ProductionFolder\\xsl\\decisionsIType.xsl


decisionIType.(class) =
decisionIType.contentType = application/pdf;charset=UTF-8
decisionIType.stylesheetLocation = file:\\\C:\\DevelopmentFolder\\xsl\\decisionsIType.xsl


I connect to file "" with a Spring bean automatically so in a xml file (by setting property "basename"="views" which makes connection to ""):

If pre-compiler directives were allowed there, then i perhaps also could there write if-else to determine if to load file "" or "".

My overall goal is to have file "" different when in Production mode and when in Development mode.
What do you suggest?
Bill Gorder
Posts: 1682
Android IntelliJ IDE Linux Mac OS X Spring
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic