Right now I had to resort to the solution below, but I would very much
like to know the standard way of doing this, as this required me to
place my properties file into the src/main/resources folder:
static {
try {
properties.load(Thread.currentThread().getContextClassLoader().getResour
ceAsStream(
"MyComponent.properties"));
} catch (Exception e) {
LOG.error("Unable to load file
MyComponent.properties' - error: {}", e.getMessage(), e);
}
}
public static String getProperty(String key) {
return properties.getProperty(key);
}
-----Original Message-----
From: Michael Mehrle [mailto:[EMAIL PROTECTED]
Sent: Sunday, June 01, 2008 3:50 PM
To: [email protected]
Subject: How to access properties files outside of Wicket components?
I just refactored one of my pages and externalized an inner class into
an outer class that however still needs access to that page's property
stings. Can I just treat that page's properties file as a resource
bundle and retrieve the strings the old fashioned way? Or will there be
problems?
Thanks,
Michael
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]