× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Joe,

I believe it does, as the classes in WEB-INF would have to be on the
classpath?

The way I do it is that I have a folder on my PC, and on the 400 called

/environment

Within environment, I have a folder for each environment eg

/environment/dev
/environment/uat
/environment/prod

within each of those, I have a folder with my environment properties file

so

/environment/dev/properties/as400.properties
/environment/uat/properties/as400.properties
/environment/prod/properties/as400.properties

So all I have to do is add this folder to the classpath for the test servers
in WDSC, so for dev I would add /environment/dev to the classpath for the
dev instance
and to the relevant dev. uat and prod websphere instances on the 400,
and thats it, job done.

as400.properties includes my JDBC url, which includes dev libraries for the
dev version, etc.

So now im comfortable that when im testing in dev or uat, the live database
files will not be accidentally updated

heres part of my utility class I use to return the properties file. I have a
hard coded method for my main properties file, and a method that takes a
properties file name as the parameter for anything else

/**

* Method getProperties.

* @return Properties object from the default as400 properties files

*/

public static Properties getProperties() {


return getProperties("properties/as400.properties");

}



/**

* Method getProperties.

* @return Properties object from the properties files

*/

public static Properties getProperties(String propertiesFile) {

// Get properties file.

try {

is = ClassLoader.getSystemClassLoader().getResourceAsStream(propertiesFile);

properties.load(is);

System.out.println("loaded properties file");

}

catch (Exception e) {

System.out.println("error loading properties file\n" + propertiesFile

+ e.toString());

e.printStackTrace();

}


return properties;

}


cheers
Colin.W

----- Original Message -----
From: "Joe Pluta" <joepluta@xxxxxxxxxxxxxxxxx>
To: "'Websphere Development Studio Client for iSeries'"
<wdsci-l@xxxxxxxxxxxx>
Sent: Thursday, December 18, 2003 9:13 PM
Subject: RE: [WDSCI-L] Importing existing JSPs etc. into new project


> > From: Colin Williams
> >
> > I have created utility classes that use
> >
> ClassLoader.getSystemClassLoader().getResourceAsStream(propertiesFile);
> >
> > This will then search the classpath for the specified file, in this
> case a
> > properties file, allowing me to use the classpath like a library list
> for
> > properties files
>
> Very interesting, Colin!  Does the classpath for WAS include any
> specific directories in the J2EE structure of a web application?  For
> example, does the WEB-INF/classes folder end up in that classpath?
> Because if it does, then I can just include my properties files in one
> of those folders and it should get included in the EAR/WAR file.
>
> Joe
>
>
> _______________________________________________
> This is the Websphere Development Studio Client for iSeries  (WDSCI-L)
mailing list
> To post a message email: WDSCI-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/wdsci-l
> or email: WDSCI-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/wdsci-l.
>



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.