Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

.ini file in Web App Environment

 
SP Nam
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am using .ini file for some properties which are used in my jsp pages.
Where to put the .ini file as it is config file specific to web application.

Any suggestion please.

SP Nam
[ November 18, 2005: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What types of properties are you talking about? ini files are not part of the standards.

You might consider properties files or context parameter entries in web.xml.
 
SP Nam
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will go with properties files, how to got about it, where to put the property file.

SP Nam
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As with any other properties file, you can place it anywhere along the classpath and retrieve using the normal Java mechanisms.

Alternatively, you can place it anywhere within the web app context and use the ServletContext.getResourceAsStream method.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65105
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. I slightly modified the title of this topic as it is not a Tomcat-specific issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic