• 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
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Constants.java class vs context param

 
Ranch Hand
Posts: 34
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm just wondering whether to keep some of my variables in Constants class or keep it in web.xml

Say, I want to keep a variable of facebook graph api prefix or api_key, client_id

From my understand, the difference between Constants.java and web.xml is web.xml is easier to rewrite on compile using ant.
So you can replace your variables in web.xml according to what environment you are building you app for. (client_id varies by dev environment/prod environment, for example)

If I get it right, then facebook graph api prefix should be kept in Constants.java (because it always is "https://graph.facebook.com/" ) and api_key,client_id should be kept in web.xml ?


Please guide me what's the proper way to use them. Thank you.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic