• 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
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Production code and Development code/settings must different

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My project has a XML file "views.properties", 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 "views.properties" so:

#ifdef Production Then

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

#else

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

#endif



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



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

My overall goal is to have file "views.properties" different when in Production mode and when in Development mode.
What do you suggest?
 
Bartender
Posts: 1682
7
Android Mac OS X IntelliJ IDE Spring Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Use Spring profiles

http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/
reply
    Bookmark Topic Watch Topic
  • New Topic