aspose file tools*
The moose likes Websphere and the fly likes wsad 5 unable to find recources Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "wsad 5 unable to find recources" Watch "wsad 5 unable to find recources" New topic
Author

wsad 5 unable to find recources

martijn van der veek
Greenhorn

Joined: Mar 17, 2003
Posts: 4
Hello,
I recently switched from wsad 4.0.3 to wsad5 and encountered the following
problem:
I have a problem of reading .properties files
I'm working with a web project en the property file is located in de source
directory. When the project is build it is automicaly copied to the output
directory.
Problem is in wsad 4.0.3 it worked perfectly and in wsad 5 im getting a
MissingResourceException.
Below are some code fragments of the call to retrieve a string from a
.properties file.
First the structure of my project
Web-project
- Java source
- packageX.Y.Z.MyServlet.java
- test.properties
- Web Content
- META-INF
- WEB-INF
- classes
- packageX.Y.Z.MyServlet.class
- test.properties
Extra info: I make use of an addition class to extract the string, this
class is called propetiesImporter.java and is located in a utility jar which
is located in the EAR.
MyServlet.java:
Properties prop = System.getProperties();
PropertiesImporter.getPropertyValue("test", "functional.test.url"));

PropertiesImporter.java:
public static String getPropertyValue(String propertyFilename, String
propertyKey) {
try {
return
java.util.ResourceBundle.getBundle(properyFilename).getString(propertyKey);
} catch (java.util.MissingResourceException e) {
return null;
}
}
! IN WSAD4 this code worked.
I hope somebody has an answer for my why this code doesn't work in WSAD5.
With kind regards,
martijn van der Veek
[ March 17, 2003: Message edited by: martijn van der veek ]
 
Don't get me started about those stupid light bulbs.
 
subject: wsad 5 unable to find recources