Hi,
In my
JSp, I am currently trying to read two name:value pairs from a properties file which is placed outside the context of the war and it works fine. My code is as follows
-------------------------------------
<%@ page import="java.io.*, java.sql.*, java.util.*" %>
<%
Properties defaultProps = new Properties();
try {
defaultProps.load(new FileInputStream("C:/server.properties"));
String appserv = defaultProps.getProperty("appserver");
String webserv = defaultProps.getProperty("webserver");
%>
-------------------------------------------
But we DO NOT want to specify a hardcoded location for the server.propertied file as in C:/ etc.
What do I need to do to access my file just as--
defaultProps.load(new FileInputStream("server.properties"));
so that it can be more flexible?
or is there a better way to do this? My server.properties file looks like this
webserver=abc
appserver=xyz
Thankyou.
V.